Use #flatten#count instead of reduce