0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2025-01-26 16:00:08 +00:00
OI-codes/Luogu/CF1146A/CF1146A.cpp

17 lines
243 B
C++
Raw Normal View History

2020-10-23 20:29:53 +08:00
#include <bits/stdc++.h>
using namespace std;
int main() {
char c;
2021-11-19 17:01:13 +08:00
int n = 0, a = 0;
2020-10-23 20:29:53 +08:00
while (cin >> c) {
n++;
if (c == 'a') {
a++;
}
}
cout << min(a * 2 - 1, n) << endl;
return 0;
}