#include <bits/stdc++.h>
using namespace std;
int f[200003], l;
char c[200003];
int s[200];
int check() {
  int ret = 2;
  for (int i = 'a'; i <= 'z'; i++) {
    if (s[i] % 2 == 1) ret--;
  }
  return ret;
}
int main() {
  char tmp = getchar();
  while (tmp >= 'a' && tmp <= 'z') {
    c[++l] = tmp;
    tmp = getchar();
  }
  f[1] = 1;
  f[0] = 0;
  for (int i = 2; i <= l; i++) {
    f[i] = f[i - 1] + 1;
    int tmp = i;
    memset(s, 0, sizeof(s));
    while (tmp != -1) {
      s[c[tmp]]++;
      if (check() >= 1) f[i] = min(f[i], f[tmp - 1] + 1);
      tmp--;
    }
  }
  printf("%d\n", f[l]);
  return 0;
}
