if i understand correctly ... you can use count property: {% Documents[path].Children.Where("ClassName = 'cms.menuitem'").Count |(identity)GlobalAdministrator%}
, but if really want do do some sort of group by you will be better off with a custom macro or you want to get # of fields in 'cms.menuitem' page type?