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())))

num = [0,0]
for i in s:
  num[i]+=1
print(min(num)*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 num = [0,0] num [0,0] 0 0 for i in s:
  num[i]+=1 i s num[i]+=1 num[i] num i 1 print(min(num)*2) print min(num)*2 min(num) min num 2 s = list(map(int,list(input()))) list(map(int,list(input()))) s def readChar():
  return input() def readChar():
  return input() readChar def readChars():
  return input().split() def readChars():
  return input().split() readChars 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 num = [0,0] [0,0] num
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())))

num = [0,0]
for i in s:
  num[i]+=1
print(min(num)*2)