NOIP '18 Junior P1 - Title Statistics

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 1.0s
Memory limit: 256M

Problem type

KaiKai just wrote a wonderful essay. Please determine the number of characters in the title of this essay. Titles may contain upper and lower case English letters, numeric characters, spaces, and newlines. Spaces and newlines are not counted when counting title characters.

Input Specification

The only lines of input contain one string, s.

Output Specification

The output should be one line containing an integer, the number of characters in the essay's title (without spaces and newlines).

Sample Input 1

234

Sample Output 1

3

Explanation for Sample 1

There are 3 characters in the title, and all 3 characters are numeric characters.

Sample Input 2

Ca 45

Sample Output 2

4

Explanation for Sample 2

There are 5 characters in the title, including 1 uppercase English letter, 1 lowercase English letter and 2 numeric characters, and 1 space. Since spaces are not counted in the results, the valid number of characters for the title is 4.

Constraints

Specifies that |s| represents the length of the string s (that is, the number of characters and spaces in the string).

For 40\% of the data, 1 \le |s| \le 5, the input is guaranteed to be numeric characters and newline characters are at the end of the line.

For 80\% of the data, 1 \le |s| \le 5, the input only contains upper and lower case English letters, numeric characters and newline characters at the end of the line.

For 100\% of the data, 1 \le |s| \le 5, the input only contains upper and lower case English letters, numeric characters, spaces, and newline characters at the end of the line.

Problem translated to English by Tommy_Shan.


Comments

There are no comments at the moment.