import sys
input = sys.stdin.readline

def main():
	S = list(input())
	S.pop(-1)
	flag = True
	count = 0
	while flag:
		ch = [0] * len(S)
		flag = False
		for i in range(len(S) - 1):
			if ch[i] == 0 and ch[i + 1] == 0:
				if (S[i] == '0' and S[i + 1] == '1') or (S[i] == '1' and S[i + 1] == '0'):
					ch[i] = 1
					ch[i + 1] = 1
					count += 1
					flag = True
		for i in range(len(ch))[::-1]:
			if ch[i] == 1:
				S.pop(i)
	print(count * 2)

if __name__ == '__main__':
	main()