#include <bits/stdc++.h>
using namespace std;
static const int INF = 0x3f3f3f3f;
int dp[202020];
bool check(vector<int> &cnt) {
  int odd = 0;
  for (int i = 0; i < cnt.size(); i++) {
    if (cnt[i] & 1) odd++;
  }
  if (odd > 1) return false;
  return true;
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n; i++) {
    vector<int> cnt(26, 0);
    for (int k = 0; k <= i; k++) {
      cnt[s[k] - 'a']++;
    }
    if (check(cnt)) {
      dp[i] = 1;
      continue;
    }
    dp[i] = INF;
    for (int j = 0; j < i; j++) {
      vector<int> cnt2(26, 0);
      for (int k = j + 1; k <= i; k++) {
        cnt2[s[k] - 'a']++;
      }
      if (check(cnt2)) {
        dp[i] = min(dp[i], dp[j] + 1);
      }
    }
  }
  printf("%d\n", dp[n - 1]);
  return 0;
}
