100 atcoder#ABC184B. [ABC184B] Quizzes
[ABC184B] Quizzes
Score : points
Problem Statement
Takahashi will answer quiz questions. Initially, he has points. Each time he answers a question, he gains point if his answer is correct and loses point if it is incorrect. However, there is an exception: when he has points, he loses nothing for answering a question incorrectly.
You will be given a string representing whether Takahashi's answers are correct.
If the -th character of from the left is o
, it means his answer for the -th question is correct; if that character is x
, it means his answer for the -th question is incorrect.
How many points will he have in the end?
Constraints
- is a string of length consisting of
o
andx
.
Input
Input is given from Standard Input in the following format:
Output
Print the number of points Takahashi will have in the end.
3 0
xox
0
Initially, he has points. He answers the first question incorrectly but loses nothing because he has no point. Then, he answers the second question correctly, gains point, and now has point. Finally, he answers the third question incorrectly, loses point, and now has points. Thus, he has points in the end. We should print .
20 199999
oooooooooxoooooooooo
200017
20 10
xxxxxxxxxxxxxxxxxxxx
0