def f(s, n, c):
    for i in range(1, n):
        if s[i-1] != s[i]:
            c += 2
            return f(s[:i-1] + s[i + 1:], n - 2, c)
    return c


if __name__ == '__main__':
    S = input()
    N = len(S)
    c = 0
    print(f(S,N,c))