#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
char str[200010] = {0};
int cs[2000010][26] = {0};
int dp[2000010] = {0};
int main() {
  int bj[26] = {0};
  int l;
  int i, j;
  scanf("%s", str);
  l = strlen(str);
  cs[0][str[0] - 'a']++;
  memset(dp, 0x3f, sizeof(dp));
  dp[0] = 1;
  for (i = 1; i < l; i++) {
    int tem = 0;
    for (j = 0; j < 26; j++) cs[i][j] = cs[i - 1][j];
    cs[i][str[i] - 'a']++;
    for (j = 0; j < 26; j++) {
      if (cs[i][j] % 2 == 1) tem++;
    }
    if (tem == 0 || tem == 1) dp[i] = 1;
  }
  for (i = 0; i < l - 1; i++) {
    if (dp[i] != INF) {
      for (j = i + 1; j < l; j++) {
        int k, tem = 0;
        for (k = 0; k < 26; k++) {
          if ((cs[j][k] - cs[i][k]) % 2 == 1) tem++;
        }
        if (tem == 0 || tem == 1) dp[j] = min(dp[j], dp[i] + 1);
      }
    }
  }
  printf("%d\n", dp[l - 1]);
  return 0;
}
