# ??00????0??0????0?0??00??1???11?1?1???1?11?111???1
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.buffer.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.buffer.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.buffer.readline().split()))



s = rr()
temp = 0
cnt = 0
c = collections.Counter(s)
print(abs(c[48] - c[49]))

    





