s = input()

stack = [s[0]]
ans = 0
for i in range(1, len(s)):
    if len(stack) == 0:
        stack.append(s[i])
        continue
    if s[i] == "0":
        if stack[-1] == "1":
            del stack[-1]
            ans += 2
        else:
            stack.append("0")
    else:
        if stack[-1] == "0":
            del stack[-1]
            ans += 2
        else:
            stack.append("1")

print(ans) s = input() s input() input stack = [s[0]] stack [s[0]] s[0] s 0 ans = 0 ans 0 for i in range(1, len(s)):
    if len(stack) == 0:
        stack.append(s[i])
        continue
    if s[i] == "0":
        if stack[-1] == "1":
            del stack[-1]
            ans += 2
        else:
            stack.append("0")
    else:
        if stack[-1] == "0":
            del stack[-1]
            ans += 2
        else:
            stack.append("1") i range(1, len(s)) range 1 len(s) len s if len(stack) == 0:
        stack.append(s[i])
        continue
     len(stack) == 0 len(stack) len stack 0 stack.append(s[i]) stack.append stack append s[i] s i continue if s[i] == "0":
        if stack[-1] == "1":
            del stack[-1]
            ans += 2
        else:
            stack.append("0")
    else:
        if stack[-1] == "0":
            del stack[-1]
            ans += 2
        else:
            stack.append("1") s[i] == "0" s[i] s i "0" if stack[-1] == "1":
            del stack[-1]
            ans += 2
        else:
            stack.append("0")
     stack[-1] == "1" stack[-1] stack -1 "1" del stack[-1] stack[-1] stack -1 ans += 2 ans 2 stack.append("0") stack.append stack append "0" if stack[-1] == "0":
            del stack[-1]
            ans += 2
        else:
            stack.append("1") stack[-1] == "0" stack[-1] stack -1 "0" del stack[-1] stack[-1] stack -1 ans += 2 ans 2 stack.append("1") stack.append stack append "1" print(ans) print ans stack = [s[0]] [s[0]] stack ans += 2 2 ans ans = 0 0 ans s = input() input() s ans += 2 2 ans
s = input()

stack = [s[0]]
ans = 0
for i in range(1, len(s)):
    if len(stack) == 0:
        stack.append(s[i])
        continue
    if s[i] == "0":
        if stack[-1] == "1":
            del stack[-1]
            ans += 2
        else:
            stack.append("0")
    else:
        if stack[-1] == "0":
            del stack[-1]
            ans += 2
        else:
            stack.append("1")

print(ans)