# -*- coding: utf-8 -*-
"""
Created on Mon Sep 14 01:36:50 2020

@author: liang
"""

S = input()
c0 = 0
c1 = 0
for i in range(len(S)):
    if S[i] == "0":
        c0 += 1
    else:
        c1 += 1
ans = len(S) - abs(c0-c1)
print(ans) """
Created on Mon Sep 14 01:36:50 2020

@author: liang
""" S = input() S input() input c0 = 0 c0 0 c1 = 0 c1 0 for i in range(len(S)):
    if S[i] == "0":
        c0 += 1
    else:
        c1 += 1 i range(len(S)) range len(S) len S if S[i] == "0":
        c0 += 1
    else:
        c1 += 1 S[i] == "0" S[i] S i "0" c0 += 1 c0 1 c1 += 1 c1 1 ans = len(S) - abs(c0-c1) ans len(S) - abs(c0-c1) len(S) len S abs(c0-c1) abs c0-c1 c0 c1 print(ans) print ans S = input() input() S c1 += 1 1 c1 ans = len(S) - abs(c0-c1) len(S) - abs(c0-c1) ans c0 = 0 0 c0 c0 += 1 1 c0 c1 = 0 0 c1
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 14 01:36:50 2020

@author: liang
"""

S = input()
c0 = 0
c1 = 0
for i in range(len(S)):
    if S[i] == "0":
        c0 += 1
    else:
        c1 += 1
ans = len(S) - abs(c0-c1)
print(ans)