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>
long long MM = 1000000007;
using namespace std;
long long gcd(long long a, long long b) {
  if (a == 0 || b == 0) return abs(a - b);
  long long res = a % b;
  while (res) {
    a = b;
    b = res;
    res = a % b;
  }
  return b;
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
long long numberofdiviser(long long a) {
  long long ans = 0;
  long long i;
  for (i = 1; i * i < a; i++) {
    if (a % i == 0) ans += 2;
  }
  if (i * i == a) ans++;
  return ans;
}
void fival(long long* a, long long b, long long n) {
  for (int i = 0; i < n; i++) {
    a[i] = b;
  }
}
long long sum, ans, l, r, x;
long long ss(vector<long long> a, vector<long long>& b, int ii) {
  for (int i = ii; i < a.size(); i++) {
    b.push_back(a[i]);
    sum += a[i];
    if (b.size() > 1 && sum >= l && sum <= r && b[b.size() - 1] - b[0] >= x)
      ans++;
    ss(a, b, i + 1);
    sum -= b[b.size() - 1];
    b.pop_back();
  }
  return ans;
}
unsigned long long fact(long long n) {
  if (n == 0) return 1;
  return n * fact(n - 1);
}
unsigned long long Combinations(unsigned long long n, unsigned long long r) {
  if (r > n) return 0;
  if (r * 2 > n) r = n - r;
  if (r == 0) return 1;
  unsigned long long res = n;
  for (int i = 2; i <= r; ++i) {
    res *= (n - i + 1);
    res /= i;
  }
  return res;
}
long long pow(long long a, long long b, long long m) {
  if (b == 0) return 1;
  if (b == 1) return a;
  long long x = pow(a, b / 2, m);
  x = (x * x) % m;
  if (b % 2) x = (x * a);
  return x % m;
}
int solve() {
  int a[2] = {0, 0};
  string s;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'a')
      a[0]++;
    else
      a[1]++;
  }
  if (a[0] > a[1])
    cout << s.size();
  else
    cout << 2 * a[0] - 1;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
}