mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-27 21:16:27 +00:00
17 lines
243 B
C++
17 lines
243 B
C++
#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;
|
|
}
|