S = raw_input();

cnt = 0;

while True:
	for i in range(len(S)):
		tmp = S.replace('01', '', 1);
		if S != tmp:
			cnt += 2;
			S = tmp;
			break;

		tmp = S.replace('10', '', 1);
		if S != tmp:
			cnt += 2;
			S = tmp;
			break;

	if len(set(S)) <= 1:
		break;

print(cnt);