upgrades on flags and count