#include <bits/stdc++.h>
using namespace std;
vector<int> hash_a;
bool isCheck(int left, int right) {
  int l = left > 0 ? hash_a[left - 1] : 0;
  int r = hash_a[right - 1];
  int calc = l ^ r;
  int bit = 0;
  while (calc > 0) {
    bit += calc & 1;
    calc >>= 1;
  }
  return bit <= 1;
}
int Solve(string s, int l, int r) {
  int left = 1e9, right = 1e9;
  if (isCheck(l, r)) {
    return 1;
  }
  for (int i = r - 1; i > l; i--) {
    if (isCheck(l, i)) {
      left = min(left, Solve(s, l, i));
      right = min(right, Solve(s, i, r));
    }
  }
  return left + right;
}
int main(void) {
  string s;
  int h = 0;
  cin >> s;
  for (int i = 0; i < s.size(); i++) {
    int bit = s[i] - 'a';
    h = h ^ (1 << bit);
    hash_a.push_back(h);
  }
  cout << Solve(s, 0, s.size()) << endl;
  return 0;
}
