Number of flags implementation