s = str(input())
ze = 0
on = 0
for i in range(len(s)):
    if s[i] == "0":
        ze += 1
    else:
        on += 1
print(len(s)-max(ze,on)+min(ze,on)) s = str(input()) s str(input()) str input() input ze = 0 ze 0 on = 0 on 0 for i in range(len(s)):
    if s[i] == "0":
        ze += 1
    else:
        on += 1 i range(len(s)) range len(s) len s if s[i] == "0":
        ze += 1
    else:
        on += 1 s[i] == "0" s[i] s i "0" ze += 1 ze 1 on += 1 on 1 print(len(s)-max(ze,on)+min(ze,on)) print len(s)-max(ze,on)+min(ze,on) len(s)-max(ze,on) len(s) len s max(ze,on) max ze on min(ze,on) min ze on on = 0 0 on ze += 1 1 ze s = str(input()) str(input()) s on += 1 1 on ze = 0 0 ze
s = str(input())
ze = 0
on = 0
for i in range(len(s)):
    if s[i] == "0":
        ze += 1
    else:
        on += 1
print(len(s)-max(ze,on)+min(ze,on))