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 PYTHON3):

Solution:
#Wrong Substraction
    # n,k= input().split()
    # n= int(n)
    # k = int(k)
    # for i in range(k):
    #     if(n%10==0):
    #         n=n/10
    #     else:
    #         n-=1
    #     n=int(n)
    # print(n) 

#Easy Question
    # n = int(input())
    # h = 0
    # for i in range(n):
    #     k=int(input())
    #     if k == 0 or 1 :
    #         if k == 0 :
    #             pass
    #         else:
    #             h = 1
    # if k == 0 or 1 :
    #     if h == 1 :
    #         print("HARD")
    #     else:
    #         print("EASY")
        
# Bear and Big Brother
    # a ,b =input().split()
    # a=int(a)
    # b=int(b)
    # count = 0
    # if a <= b:
    #     while a<=b:
    #         a*=3
    #         b*=2
    #         count+=1
    #     print(int(count))

#Anton and Polyhedrons
    # n = int(input())
    # count = 0
    # for i in range(n):
    #     s=input()
    #     if(s == 'Tetrahedron'):
    #         count+=4
    #     elif(s== 'Cube'):
    #         count+=6
    #     elif(s=='Octahedron'):
    #         count+=8
    #     elif(s=='Dodecahedron'):
    #         count+=12
    #     elif(s=='Icosahedron'):
    #         count+=20
    #     else:
    #         count+=0
    # print(int(count))

#Hit the Lottery
    # n = int(input())
    # count = 0
    # while (n!=0):
    #     if(n>=100):
    #         n-=100
    #         count+=1
    #         continue
    #     if(20<=n):
    #         n-=20
    #         count+=1
    #         continue
    #     if(10<=n):
    #         n-=10
    #         count+=1
    #         continue
    #     if(5<=n):    
    #         n-=5
    #         count+=1
    #         continue
    #     if(1<=n):
    #         n-=1
    #         count+=1
    #         continue
    # print(int(count))
        
#Restoring Three Numbers
    # #include<bits/stdc++.h>
    # using namespace  std;
    # int main()
    # {
    # int a[4],ar,b,c,i;
    # while(cin>>a[0]>>a[1]>>a[2]>>a[3])
    # {
    # sort(a,a+4);
    # ar=a[3]-a[0];
    # b=a[3]-a[2];
    # c=a[3]-a[1];
    # cout<<ar<<" "<<b<<" "<<c<<endl;

    # }

    # }

#Gennady and a Card Game

    # c = 0
    # n = input()
    # for i in range(5):
    #     i1 = input()
    #     if (n[0]==i1[0] or n[1]==i1[1]):
    #         c+=1
    # if(c>0):
    #     print("YES",end=" ")
    # else:
    #     print("NO",end=" ")

#Fafa and his Company
    # #include<bits/stdc++.h>
    # using namespace  std;
    # int main()
    # {
    # int n,i,c=0,h;

    # cin >> n;
    # h=n/2;
    # for(i=1;i<=h;i++)
    # {
    #     if(n%i == 0)
    #     {
    #     c++;
    #     }
    # }
    # cout << c;
    # }

#Vus the Cossack and a Contest
    # n,m,k= input().split(" ")
    # n=int(n)
    # m=int(m)
    # k=int(k)
    # if (n<=m and n<=k):
    #     print("Yes")
    # else:
    #     print("No")

#Cards
    # n = int(input("enter n: "))
    # zero= 0 
    # one = 0
    # s = input("enter the string: ")
    # for i in range(len(s)):
    #     if(s[i]=='z'):
    #         --zero
    #     if(s[i]=='n'):
    #         --one

    # while(one-1):
    #     break
    # while(zero-1):
    #     print("0")

#New Year and Naming
    # #include<bits/stdc++.h>
    # using namespace  std;
    # int main()
    # {
    # int m,n,i,q,x;
    # string sn[20],sm[20];
    # std::cin >> n;
    # std::cin >> m;
    # for(i=0;i<n;i++)
    # {
    #     std::cin >> sn[i];
    # }
    # for(i=0;i<m;i++)
    # {
    #     std::cin >> sm[i];
    # }
    # std::cin >> q;
    # while (q--)
    # {
    #     std::cin >> x;
    #     x--;
    #     std::cout << sn[x%n]+sm[x%m]<<endl;
    # }
    # }

#Between the Offices
    # n = int(input())
    # s= input()
    # cs=0
    # cns=0
    # s=list(s)
    # if(n==len(s)):
    #     for i,j in zip(range(0,len(s)-1),range(1,len(s))):
    #             if(s[i]=='S'):
    #                 if(s[j]=='F'):
    #                     cs+=1
    #                 else:
    #                     continue
    #             elif(s[i]=='F'):
    #                 if(s[j] == 'S'):
    #                     cns+=1
    #                 else:
    #                     continue
            
    # if(cs>cns):
    #     print("YES")
    # elif(cns>=cs):
    #     print("NO")

#Love "A"
s= input()
count=0
for i in range(len(s)):
    if(s[i]=='a'):
        count+=1
if(count > (len(s)/2)):
    print(len(s))

else:
    print((count*2)-1)