0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 18:52:02 +00:00

CF1146A Love "A"

R40362120
This commit is contained in:
Baoshuo Ren 2020-10-23 20:29:53 +08:00 committed by Baoshuo Ren
parent 07eb0d6a28
commit 1dd1d5a132
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

View File

@ -0,0 +1,16 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
char c;
int n = 0, a = 0;
while (cin >> c) {
n++;
if (c == 'a') {
a++;
}
}
cout << min(a * 2 - 1, n) << endl;
return 0;
}