import queue
counter = 0
S = input()
S = list(S)
q = queue.Queue()
flg = 1
for i in range(len(S)):
  q.put(S[i])
for i in range(100):
  if(q.empty()):
    break
  else:
    if (flg == 1):
      s1 = q.get()
    s2 = q.get()
    if (s1 != s2):
      counter+=2
      flg = 1
    else:
      s1 = s2
      flg = 0
print(counter)