Problem: Alice has a string s. She really likes the letter "a". She calls a string good if strictly more than half of the characters in that string are "a"s. For example "aaabb", "axaa" are good strings, and "baca", "awwwa", "" (empty string) are not.

Alice can erase some characters from her string s. She would like to know what is the longest string remaining after erasing some characters (possibly zero) to get a good string. It is guaranteed that the string has at least one "a" in it, so the answer always exists.

Input

The first line contains a string s (1 ≤ |s| ≤ 50) consisting of lowercase English letters. It is guaranteed that there is at least one "a" in s.

Output

Print a single integer, the length of the longest good string that Alice can get after erasing some characters from s.

Examples

Input


xaxxxxa


Output


3


Input


aaabaa


Output


6

Note

In the first example, it's enough to erase any four of the "x"s. The answer is 3 since that is the maximum number of characters that can remain.

In the second example, we don't need to erase any characters.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long int nCrModp(long int n, long int r, long int p) {
  long long int C[r + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (long int i = 1; i <= n; i++) {
    for (long int j = min(i, r); j > 0; j--) C[j] = (C[j] + C[j - 1]) % p;
  }
  return C[r];
}
long long int pmod(long long int _a, long long int _b, long long int _m) {
  long long int _r = 1;
  while (_b) {
    if (_b % 2 == 1) _r = (_r * _a) % _m;
    _b /= 2;
    _a = (_a * _a) % _m;
  }
  return _r;
}
long int fast() {
  long int val = 0;
  char c = getchar();
  while (c < 33) c = getchar();
  while (c > 33) val = (val << 1) + (val << 3) + (c - '0'), c = getchar();
  return val;
}
long long int fastt() {
  long long int val = 0;
  char c = getchar();
  while (c < 33) c = getchar();
  while (c > 33) val = (val << 1) + (val << 3) + (c - '0'), c = getchar();
  return val;
}
bool pal(char *a, int l) {
  for (int i = 0; i < l / 2; i++) {
    if (a[i] != a[l - i - 1]) return 0;
  }
  return 1;
}
bool isprime(long int n) {
  for (long int i = 3; i * i <= n; i += 2) {
    if (n % i == 0) return 0;
  }
  return 1;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int gcdExtended(long long int a, long long int b, long long int *x,
                          long long int *y) {
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  long long int x1, y1;
  long long int gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
long long int modInverse(long long int a, long long int m) {
  long long int x, y;
  long long int g = gcdExtended(a, m, &x, &y);
  long long int res = (x % m + m) % m;
  return res;
}
int main() {
  string s;
  cin >> s;
  int c = 0;
  for (int i = 0; i < s.length(); i++) {
    if (s[i] == 'a') c++;
  }
  cout << min((int)s.length(), c * 2 - 1) << endl;
}