s = raw_input()
def cal(s):
	a= 0
	for idx in range(len(s)/2):
		if s[2*idx]==s[2*idx +1]:
			continue
		else:
			a = 1
			s = s[2*(idx+1):]
			break

	if a:
		return cal(s)
	else:
		return s

print(len(cal(s)))