Flag counter