As an aside, unrelated to your actual code, this exercise sets you up for some bad coding standards. leg_number and wing_number should be legCount and wingCount, in keeping with the naming conventions.
"number of legs" would be correct English, but "leg count" is more idiomatic to a programmer and shout therefore be favored.
"leg number" doesn't mean what this exercise think it does. A "leg number" is the number given to a specific leg, e.g. "this is leg 5" (similar to "player 1", "aisle 5", "Apollo 13"). The number does not denote a total amount, it denotes a specific number given to a specific instance. There can be more players, more aisles, and more Apollo missions than the number indicates.