An arcade prize counter is going through today's batch of redeemed tickets. Each ticket is stamped with a positive integer serial number, and the counter staff award a bonus stamp to any ticket whose serial number is written with an even number of digits (so 1234, having 4 digits, qualifies, and 88, having 2 digits, also qualifies, but 7 and 345 do not). Given the serial numbers of every ticket redeemed today, determine how many of them qualify for the bonus stamp.
n (1 <= n <= 500) — the number of tickets redeemed today.n space-separated integers, the serial number stamped on each ticket, each between 1 and 100000 (10^5) inclusive.Print a single integer: the number of tickets whose serial number has an even number of digits.
Example 1
Input
6 102 5 4321 89 7 1000
Expected
3
Explanation
Digit counts are 102->3 (odd), 5->1 (odd), 4321->4 (even), 89->2 (even), 7->1 (odd), 1000->4 (even). Three tickets (4321, 89, 1000) qualify, so the answer is 3.
Example 2
Input
4 7 88 999 10
Expected
2
Explanation
Digit counts are 7->1 (odd), 88->2 (even), 999->3 (odd), 10->2 (even). Two tickets (88, 10) qualify, so the answer is 2.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →