#K66277. Count Words and Numbers

    ID: 32385 Type: Default 1000ms 256MiB

Count Words and Numbers

Count Words and Numbers

Given a string containing a mixture of words and numbers separated by spaces, your task is to count the number of words and numeric tokens within the string.

A word is defined as a sequence consisting entirely of alphabetic characters (a–z, A–Z), and a number is defined as a sequence consisting only of digits (0–9). The tokens in the input are separated by one or more spaces.

For example, for the input:

hello 123 world 4567 python 89 code

the output should be:

4 3

where 4 represents the count of words and 3 represents the count of numbers.

You need to read the input from standard input (stdin) and print the result to standard output (stdout) in the specified format.

inputFormat

The input consists of a single line containing a string with tokens separated by spaces. Each token is either a word (comprising only letters) or a number (comprising only digits).

outputFormat

Output two integers separated by a space. The first integer is the count of words and the second integer is the count of numbers found in the input string.

## sample
hello 123 world 4567 python 89 code
4 3