Set maximum number of allowed flags.