#C13958. Alphabet and Number Counter

    ID: 43553 Type: Default 1000ms 256MiB

Alphabet and Number Counter

Alphabet and Number Counter

You are given a string as input. Your task is to count the number of alphabetical characters (both uppercase and lowercase) and the number of numeric characters present in the string. All other characters, including punctuation and whitespace, should be ignored.

Details:

  • Alphabetical characters are any letters from A-Z or a-z.
  • Numeric characters are any digits from 0-9.

For example, given the input "Hello World! 123", the output should be "10 3" because there are 10 letters and 3 digits.

The answer should be produced by reading the input from standard input (stdin) and printing the result to standard output (stdout) as two space-separated integers.

The task is straightforward and tests basic string processing skills.

inputFormat

The input consists of a single line string. The string may contain letters, digits, spaces, and various other characters.

outputFormat

Output two integers separated by a space. The first integer is the total count of alphabetic characters, and the second integer is the total count of numeric characters.

For example, if the input is "Hello World! 123", the output should be:

10 3
## sample
Hello World! 123
10 3