import sys
import heapq
hpush = heapq.heappush
hpop = heapq.heappop
from collections import defaultdict as dd
input = sys.stdin.readline
S = list(input())[: -1]
N = len(S)
cs = [0] * (N + 1)
a = ord("a")
table = [1 << x for x in range(27)]
for i in range(N):
  cs[i + 1] = cs[i] ^ table[(ord(S[i]) - a)]
#print(cs)
d = dd(list)
for i in range(N, -1, -1): d[cs[i]].append(i)
#print(d)

dist = [N] * (N + 1)
vis = [0] * (N + 1)
dist[0] = 0
h = [0]
while len(h):
  v = hpop(h)
  v1 = v % (10 ** 6)
  v0 = v // (10 ** 6)
  if vis[v1]: continue
  vis[v1] = 1
  for i in range(26):
    for x in d[cs[v1] ^ table[i]]:
      if dist[x] > dist[v1] + 1:
        dist[x] = dist[v1] + 1
        hpush(h, dist[x] * (10 ** 6) + x)
    while len(d[cs[v1] ^ table[i]]):
      if d[cs[v1] ^ table[i]][-1] <= v1: d[cs[v1] ^ table[i]].pop()
      else: break
  for x in d[cs[v1]]:
    if dist[x] > dist[v1] + 1:
      dist[x] = dist[v1] + 1
      hpush(h, dist[x] * (10 ** 6) + x)
  while len(d[cs[v1]]):
    if d[cs[v1]][-1] <= v1: d[cs[v1]].pop()
    else: break
print(dist[-1])
