counter for flags