S = list(input())

i = 0
count = 0
while i < len(S)-1:
  if S[i] != S[i+1]:
    del S[i:i+2]
    count += 2
    if i != 0:
      i -= 1
  else:
    i += 1
print(count) S = list(input()) S list(input()) list input() input i = 0 i 0 count = 0 count 0 while i < len(S)-1:
  if S[i] != S[i+1]:
    del S[i:i+2]
    count += 2
    if i != 0:
      i -= 1
  else:
    i += 1 i < len(S)-1 i len(S)-1 len(S) len S 1 if S[i] != S[i+1]:
    del S[i:i+2]
    count += 2
    if i != 0:
      i -= 1
  else:
    i += 1 S[i] != S[i+1] S[i] S i S[i+1] S i+1 i 1 del S[i:i+2] S[i:i+2] S i:i+2 i i+2 i 2 count += 2 count 2 if i != 0:
      i -= 1
   i != 0 i 0 i -= 1 i 1 i += 1 i 1 print(count) print count count = 0 0 count i -= 1 1 i count += 2 2 count i += 1 1 i S = list(input()) list(input()) S i = 0 0 i
S = list(input())

i = 0
count = 0
while i < len(S)-1:
  if S[i] != S[i+1]:
    del S[i:i+2]
    count += 2
    if i != 0:
      i -= 1
  else:
    i += 1
print(count)