from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

s = list(map(int,list(input())))

d = [-1]
ans = 0
for i in s:
  if d[-1]+i==1:
    del d[-1]
    ans+=1
  else:
    d.append(i)
print(ans*2) from collections import defaultdict def readInt():
  return int(input()) readInt return int(input()) int(input()) int input() input def readInts():
  return list(map(int, input().split())) readInts return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split def readChar():
  return input() readChar return input() input() input def readChars():
  return input().split() readChars return input().split() input().split() ().split () input split s = list(map(int,list(input()))) s list(map(int,list(input()))) list map(int,list(input())) map int list(input()) list input() input d = [-1] d [-1] -1 ans = 0 ans 0 for i in s:
  if d[-1]+i==1:
    del d[-1]
    ans+=1
  else:
    d.append(i) i s if d[-1]+i==1:
    del d[-1]
    ans+=1
  else:
    d.append(i) d[-1]+i==1 d[-1]+i d[-1] d -1 i 1 del d[-1] d[-1] d -1 ans+=1 ans 1 d.append(i) d.append d append i print(ans*2) print ans*2 ans 2 def readInt():
  return int(input()) def readInt():
  return int(input()) readInt def readInts():
  return list(map(int, input().split())) def readInts():
  return list(map(int, input().split())) readInts d = [-1] [-1] d ans = 0 0 ans ans+=1 1 ans def readChar():
  return input() def readChar():
  return input() readChar def readChars():
  return input().split() def readChars():
  return input().split() readChars s = list(map(int,list(input()))) list(map(int,list(input()))) s
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

s = list(map(int,list(input())))

d = [-1]
ans = 0
for i in s:
  if d[-1]+i==1:
    del d[-1]
    ans+=1
  else:
    d.append(i)
print(ans*2)