Hi Nadezhda,
GO is not really related to pathways, it is rather a collection of associated terms (i.e. an ontology) that collectively describe a set of genes. If you want to perform pathway-enrichment analysis, you should rather go for KEGG or Reactome enrichment analysis.
The count that you see is the number of genes in you analysis, i.e. the hyper- or hypomethylated genes that are associated with this GO ontology term, and the enrichment tests if there are significantly more genes in this category than expected by chance. They don't need to be the top genes in the GO term, but any of them is sufficient.
Hope that helps,
Michael