from itertools import accumulate

s = input()
N = len(s)
cnt = [[0] * (N+1) for _ in range(26)]
for i in range(N):
    cnt[ord(s[i]) - ord('a')][i+1] += 1
for c in range(26):
    cnt[c] = list(accumulate(cnt[c]))

dp = [0] * (N+1)

for i in range(N):
    dp[i+1] = dp[i] + 1
    for j in range(i):
        odd = 0
        for c in range(26):
            if (cnt[c][i+1] - cnt[c][j]) % 2 == 1:
                odd += 1
        if odd <= 1:
            dp[i+1] = min(dp[i+1], dp[j] + 1)
print(dp[-1])