import sys
input = sys.stdin.readline
s = input()
n = len(s)
slist = [int(i)for i in s]
q = True
ans = 0
while q:
  q = False
  kesu = 0
  for i in range(1,len(slist)):
    if slist[i] != slist[i-1]:
      kesu = i
      ans += 2
      q = True
      break
  if kesu != 0:
    del slist[kesu-1:kesu+1]
print(ans)
