Problems > Count Even Digits

Count Even Digits

Difficulty: 800 2000 ms 128 MB

implementation

Count how many digits of N are even (0, 2, 4, 6 or 8).

Input: one integer N.

Output: the number of even digits.

Constraints:

  • 0 ≤ N ≤ 1018

Sample Tests

Input 1
2739
Output 1
1
Input 2
2048
Output 2
4

Read the Editorial

Discussion (opens after you solve — no spoilers before)

No comments yet.

Submit Your Solution

Log in or create a free account to run and submit code.