s = list(input())
c0 = s.count("0")
c1 = s.count("1")
if c0 >= c1:
    print(2*c1)
else:
    print(2*c0) s = list(input()) s list(input()) list input() input c0 = s.count("0") c0 s.count("0") s.count s count "0" c1 = s.count("1") c1 s.count("1") s.count s count "1" if c0 >= c1:
    print(2*c1)
else:
    print(2*c0) c0 >= c1 c0 c1 print(2*c1) print 2*c1 2 c1 print(2*c0) print 2*c0 2 c0 s = list(input()) list(input()) s c0 = s.count("0") s.count("0") c0 c1 = s.count("1") s.count("1") c1
s = list(input())
c0 = s.count("0")
c1 = s.count("1")
if c0 >= c1:
    print(2*c1)
else:
    print(2*c0)