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

print(ans)