NOIP '18 Junior P1 - Title Statistics
View as PDFKaiKai 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, .
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  characters in the title, and all 
 characters are numeric characters.
Sample Input 2
Ca 45
Sample Output 2
4
Explanation for Sample 2
There are  characters in the title, including 
 uppercase English letter, 
 lowercase English letter and 
 numeric characters, and 
 space. Since spaces are not counted in the results, the valid number of characters for the title is 
.
Constraints
Specifies that  represents the length of the string 
 (that is, the number of characters and spaces in the string).
For  of the data, 
, the input is guaranteed to be numeric characters and newline characters are at the end of the line.
For  of the data, 
, the input only contains upper and lower case English letters, numeric characters and newline characters at the end of the line.
For  of the data, 
, 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 .
Comments