def main():
  s = input()
  n = len(s)
  cnt = [0] * 26
  sum = [0] * (n + 1)

  for i in range(1, n + 1):
    ind = ord(s[i - 1]) - ord('a')
    cnt[ind] += 1
    sum[i] = sum[i - 1]
    if (cnt[ind] & 1) == 1:
      sum[i] += 1
    else:
      sum[i] -= 1

  f = [0] * (n + 1)
  for i in range(1, n + 1):
    f[i] = 0x7fffffff
    for j in range(i):
      if sum[i] >= sum[j] and sum[i] - sum[j] <= 1:
        f[i] = min(f[i], f[j] + 1)
  print(f[n])


if __name__ == '__main__':
  main()