#include <bits/stdc++.h>
using namespace std;
int n, p;
char c[200005];
int a[200005][26];
int s[200005][26];
int f[200005];
int tmp[26];
int main() {
  scanf("%s", c + 1);
  n = strlen(c + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 26; j++) s[i][j] = s[i - 1][j];
    int t = c[i] - 'a';
    a[i][t] = 1;
    s[i][t]++;
  }
  for (int i = 1; i <= n; i++) {
    int t = max(0, i - 351), od = 0;
    for (int j = 0; j < 26; j++) {
      tmp[j] = s[i][j] - s[t][j];
      if (tmp[j] % 2 == 1) od++;
    }
    f[i] = 99999999;
    if (od <= 1) f[i] = min(f[i], f[t] + 1);
    if (od <= 1) f[i] = f[t] + 1;
    for (int j = t + 1; j < i; j++) {
      if (tmp[c[j] - 'a'] & 1)
        od--;
      else
        od++;
      tmp[c[j] - 'a']--;
      if (od <= 1) f[i] = min(f[i], f[j] + 1);
    }
  }
  printf("%d\n", f[n]);
  return 0;
}
