#! usr/bin/env python3
#D:

def is_kaibun (S):
	#戻り値が0:回文,1:回文無理
	l = len(S)
	S.sort()

	i = 0


	if l % 2 == 1:
		sign = 0
		
		while True:
			if i >= l-1:
				return 0
			elif S[i] == S[i+1]:
				i += 2
			else:
				if sign == 1:
					return 1
				else:
					sign += 1
					i += 1

	else:
		while True:
			if i >= l-1:
				return 0
			elif S[i] == S[i+1]:
				i += 2
			else:
				return 1


S = list(input())
i = len(S)

front = 0
last = i

devide = 0

while True:
	if front == last:
		break

	if (is_kaibun(S[front:i]) == 0 ) or (i == front):
		devide += 1
		front = i
		i = last

	else:
		i -= 1

print(devide)