AtCoder Beginner Contest 184
B
Quizzes
AtCoder
⌀ 0
原题
← AC →
翻译中…

Problem Statement

翻译中…

Takahashi will answer $N$ quiz questions. Initially, he has $X$ points. Each time he answers a question, he gains $1$ point if his answer is correct and loses $1$ point if it is incorrect. However, there is an exception: when he has $0$ points, he loses nothing for answering a question incorrectly.

翻译中…

You will be given a string $S$ representing whether Takahashi's answers are correct. If the $i$-th character of $S$ from the left is o, it means his answer for the $i$-th question is correct; if that character is x, it means his answer for the $i$-th question is incorrect. How many points will he have in the end?

翻译中…

Constraints

翻译中…
  • $1 \le N \le 2 \times 10^5$
  • $0 \le X \le 2 \times 10^5$
  • $S$ is a string of length $N$ consisting of o and x.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N X
S

翻译中…

Output

翻译中…

Print the number of points Takahashi will have in the end.

翻译中…

样例

Input #1
3 0
xox
Output #1
0
Initially, he has $0$ points. He answers the first question incorrectly but loses nothing because he has no point. Then, he answers the second question correctly, gains $1$ point, and now has $1$ point. Finally, he answers the third question incorrectly, loses $1$ point, and now has $0$ points. Thus, he has $0$ points in the end. We should print $0$.
Input #2
20 199999
oooooooooxoooooooooo
Output #2
200017
Input #3
20 10
xxxxxxxxxxxxxxxxxxxx
Output #3
0
题目信息
题号
abc184_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。