def f(s, c):
    num = 2 * s.count('01')
    s = s.replace("01", "")
    num += 2 * s.count('10')
    s = s.replace("10", "")
    if num == 0:
        return c
    return f(s, c+num)


    # 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)


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