#include <bits/stdc++.h>
using namespace std;
int n, p;
char c[200005];
int a[200005][26];
int s[200005][26];
int f[200005], g[200005], h[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 - 1000), od = 0;
    int ff = 0;
    for (int j = 0; j < 26; j++) {
      tmp[j] = s[i][j] - s[t][j];
      if (tmp[j] % 2 == 1) od++, ff ^= (1 << j);
    }
    f[i] = 99999999;
    if (od == 0) {
      if (t == 0)
        f[i] = 1, g[i] = h[i] = 0;
      else {
        if (f[t] < f[i] || g[t] == 0) {
          g[i] = g[t];
          h[i] = h[t];
        }
        f[i] = min(f[t], f[i]);
      }
    }
    if (od == 1) {
      if (t == 0)
        f[i] = 1, g[i] = 1, h[i] = ff;
      else {
        if (h[t] & ff) {
          g[i] = 0;
          h[i] = 0;
          f[i] = min(f[t], f[i]);
        } else if (g[t] == 0) {
          g[i] = 1;
          if (f[t] < f[i]) {
            h[i] = ff;
          }
          f[i] = min(f[t], f[i]);
        } else {
          g[i] = 1;
          if (f[t] + 1 < f[i]) {
            h[i] = ff;
          } else if (f[t] + 1 == f[i]) {
            h[i] |= ff;
          }
          f[i] = min(f[t] + 1, f[i]);
        }
      }
    }
    for (int j = t + 1; j < i; j++) {
      if (tmp[c[j] - 'a'] & 1)
        od--;
      else
        od++;
      tmp[c[j] - 'a']--;
      ff ^= (1 << (c[j] - 'a'));
      if (od == 0) {
        if (j == 0)
          f[i] = 1, g[i] = h[i] = 0;
        else {
          if (f[j] < f[i] || g[j] == 0) {
            g[i] = g[j];
            h[i] = h[j];
          }
          f[i] = min(f[j], f[i]);
        }
      }
      if (od == 1) {
        if (j == 0)
          f[i] = 1, g[i] = 1, h[i] = ff;
        else {
          if (h[j] & ff) {
            g[i] = 0;
            h[i] = 0;
            f[i] = min(f[j], f[i]);
          } else if (g[j] == 0) {
            g[i] = 1;
            if (f[j] < f[i]) {
              h[i] = ff;
            }
            f[i] = min(f[j], f[i]);
          } else {
            g[i] = 1;
            if (f[j] + 1 < f[i]) {
              h[i] = ff;
            } else if (f[j] + 1 == f[i]) {
              h[i] |= ff;
            }
            f[i] = min(f[j] + 1, f[i]);
          }
        }
      }
    }
  }
  printf("%d\n", f[n]);
  return 0;
}
