There are 2 keys per level in Sonic Heroes, with the exception of boss levels, which don't follow the same rule.