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:
import math

def list_str(l, char):
    output_str = ""
    for i in range(len(l) - 1):
        output_str += str(l[i]) + char
    output_str += str(l[len(l) - 1])
    return output_str


def str_list(s, char):
    output_list  = []
    intermediate  = ""
    for i in range(len(s)):
        if s[i] != char:
            intermediate += s[i]
            if i == len(s) - 1:
                output_list.append(int(intermediate))
        else:
            if intermediate:
                output_list.append(int(intermediate))
                intermediate = ""
    return output_list


def merge_sort(l):
    def merge(l1, l2):
        i, j = 0, 0
        output_list = []
        while i < len(l1) and j < len(l2):
            if l1[i] > l2[j]:
                output_list.append(l1[i])
                i += 1
            else:
                output_list.append(l2[j])
                j += 1
        if i == len(l1):
            output_list += l2[j:]
        elif j == len(l2):
            output_list += l1[i:]
        return output_list

    def sort(l):
        if len(l) < 2:
            return l
        else:
            mid = len(l) // 2
            left = sort(l[:mid])
            right = sort(l[mid:])
            return merge(left, right)
    return sort(l)



def quicksort(l):
    def partition(l, start, end):
        i = start
        ind_pivot = end
        for j in range(start, end):
            if l[j] >= l[ind_pivot]:
                l[j], l[i] = l[i], l[j]
                i += 1
        l[ind_pivot], l[i] = l[i], l[ind_pivot]
        return i


    def quick_sort(l, start, end):
        if len(l) < 2:
            return l
        elif start < end:
            p = partition(l, start, end)
            quick_sort(l, start, p - 1)
            quick_sort(l, p + 1, end)
    quick_sort(l, 0, len(l) - 1)
    return l

# k = [ 2,4,3,2,1,2,3,4,5,6,5,4,3,2]
# quicksort(k)
# print(k)


def collector_recursive(l):
    output_list = []
    def colec(l, start, end, cl):
        if start > end:
            return cl
        else:
            cl.append(f"{l[start][1]} {l[end][1]}")
            return colec(l, start + 1, end - 1, cl)
    return colec(l, 0, len(l) - 1, output_list)






def main_function():
    s = input()
    count_a = 0
    for i in s:
        if i == "a":
            count_a += 1
    if count_a > len(s) // 2:
        return len(s)
    return count_a * 2 - 1




print(main_function())