Problems > Letters versus Digits

Letters versus Digits

Difficulty: 800 2000 ms 128 MB

strings

The string contains lowercase letters and digits. Count each kind.

Input: one line with S.

Output: two integers: the number of letters, then the number of digits.

Constraints:

  • 1 ≤ |S| ≤ 104
  • S contains lowercase letters and digits

Sample Tests

Input 1
a1b22c
Output 1
3 3
Input 2
999
Output 2
0 3

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.