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 find_mod(string s) {
  long long int i, x = 0;
  for (i = 0; i < s.length(); i++) x = (x * 10 + s[i] - '0') % 100000000000007;
  return x;
}
long long int prime[7000005 + 1];
void sieve1() {
  for (int i = 0; i <= 7000005; i++) prime[i] = 1;
  prime[0] = prime[1] = 0;
  for (long long int i = 4; i <= 7000005; i += 2) prime[i] = 0;
  for (int p = 3; p * p <= 7000005; p += 2) {
    if (prime[p] == 1)
      for (int i = p * 2; i <= 7000005; i += p) {
        prime[i] = 0;
      }
  }
}
int min_prime_div_of_n[7000005 + 1];
void sieve2() {
  memset(min_prime_div_of_n, 0, sizeof(min_prime_div_of_n));
  min_prime_div_of_n[0] = min_prime_div_of_n[1] = 1;
  for (int i = 2; i * i <= 7000005; i++) {
    if (min_prime_div_of_n[i] == 0) {
      for (int j = i * 2; j < 7000005; j += i) {
        if (min_prime_div_of_n[j] == 0) {
          min_prime_div_of_n[j] = i;
        }
      }
    }
  }
  for (int i = 2; i <= 7000005; i++)
    if (min_prime_div_of_n[i] == 0) min_prime_div_of_n[i] = i;
}
int max_prime_div_of_n[7000005 + 1];
void sieve3() {
  sieve1();
  memset(max_prime_div_of_n, 0, sizeof(max_prime_div_of_n));
  max_prime_div_of_n[0] = max_prime_div_of_n[1] = 1;
  for (int i = 2; i * i <= 7000005; i++) {
    if (max_prime_div_of_n[i] == 0) {
      for (int j = i * 2; j < 7000005; j += i) {
        if (max_prime_div_of_n[j] == 0 || ((j % i) == 0 && prime[i] == 1)) {
          max_prime_div_of_n[j] = i;
        }
      }
    }
  }
  for (int i = 2; i <= 100; i++)
    if (max_prime_div_of_n[i] == 0) max_prime_div_of_n[i] = i;
}
long long int sum_prime_fac[1000001];
void sieve4() {
  sum_prime_fac[1000001] = {0};
  for (long long int i = 2; i <= 1000000; i++) {
    if (!sum_prime_fac[i]) {
      for (long long int j = i; j <= 1000000; j += i) sum_prime_fac[j] += i;
    }
  }
}
bool is_even(long long int n) { return (!(n & 2)); }
bool is_odd(long long int n) { return (n & 2); }
long long int sum(long long int n) {
  long long int sum = 0;
  while (n) {
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
bool isprime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n == 5) return true;
  if ((n % 2 == 0) || (n % 3 == 0) || (n % 5 == 0)) return false;
  for (long long int i = 5; i * i <= n; i += 6)
    if ((n % i == 0) || (n % (i + 2) == 0)) return false;
  return true;
}
long long int reversenum(long long int x) {
  long long int num = 0;
  while (x > 0) {
    num = num * 10 + x % 10;
    x = x / 10;
  }
  return num;
}
bool ispalindrome(string s) {
  string q = s;
  reverse(q.begin(), q.end());
  return (s == q);
}
bool isvowel(char x) {
  return (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u');
}
long long int mceil(long long int a, long long int b) {
  if (a % b == 0)
    return (a / b);
  else
    return (a / b + 1);
}
long long int mfloor(long long int a, long long int b) {
  if (a % b == 0)
    return (a / b);
  else
    return (a / b - 1);
}
long long int sumarr(long long int a[], long long int n) {
  long long int sum = 0;
  for (long long int i = 0; i < n; i++) sum += a[i];
  return sum;
}
long long modmul(long long a, long long b) {
  return ((a % 100000000000007) * (b % 100000000000007)) % 100000000000007;
}
long long modadd(long long a, long long b) {
  return ((a % 100000000000007) + (b % 100000000000007) + 100000000000007) %
         100000000000007;
}
long long modsub(long long a, long long b) {
  return ((a % 100000000000007) - (b % 100000000000007) + 100000000000007) %
         100000000000007;
}
long long int fastexpo(long long int a, long long int b) {
  a = a % 100000000000007;
  long long int ans = 1;
  while (b) {
    if (b % 2) ans = (ans * 1ll * a) % 100000000000007;
    a = (a * 1ll * a) % 100000000000007;
    b = b / 2;
  }
  return ans;
}
long long int findmax(long long int a[], long long int x, long long int y) {
  long long int maxi = -1;
  for (long long int i = x; i <= y; i++) maxi = max(maxi, a[i]);
  return maxi;
}
long long int phi[7000005];
void euler_phi() {
  for (long long int i = 0; i < 7000005 - 1; i++) phi[i + 1] = i + 1;
  for (long long int p = 2; p < 7000005; p++) {
    if (phi[p] == p) {
      phi[p] = p - 1;
      for (long long int i = 2 * p; i < 7000005; i += p)
        phi[i] = (phi[i] / p) * (p - 1);
    }
  }
}
long long int myphi(long long int n) {
  long long int result = n;
  for (long long int p = 2; p * p <= n; ++p) {
    if (n % p == 0) {
      while (n % p == 0) n /= p;
      result -= result / p;
    }
  }
  if (n > 1) result -= result / n;
  return result;
}
void prime_factorise(long long int n, map<long long int, long long int> &mp) {
  while (n % 2 == 0) {
    mp[2]++;
    n /= 2;
  }
  for (long long int i = 3; i * i <= n; i += 2) {
    while (n % i == 0) {
      mp[i]++;
      n /= i;
    }
  }
  if (n > 1) mp[n]++;
}
long long int largestPower(long long int n, long long int p) {
  long long int total = 0;
  while (n) {
    n /= p;
    total += n;
  }
  return total;
}
long long int fact[100001];
void facto() {
  fact[0] = 1;
  for (long long int i = 1; i <= 100000; i++) fact[i] = modmul(fact[i - 1], i);
}
void finddiv(long long int n, set<long long int> &st) {
  for (long long int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      st.insert(i);
      st.insert(n / i);
    }
  }
}
long long int findncr(long long int n, long long int r) {
  if (n < r)
    return 0;
  else {
    r = min(r, n - r);
    long long int a = 1, b = 1;
    for (long long int i = 0; i < r; i++) {
      a = (a * (n - i)) % 100000000000007;
      b = (b * (i + 1)) % 100000000000007;
    }
    a = modmul(a, fastexpo(b, 100000000000007 - 2));
    return a;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t = 1;
  while (t--) {
    string s;
    cin >> s;
    long long int cnt = 0;
    for (long long int i = 0; i < int(s.size()); i++)
      if (s[i] == 'a') cnt++;
    long long int op = int(s.size());
    cout << min(op, 2 * cnt - 1LL);
  }
  return 0;
}