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