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