#include <bits/stdc++.h>
using namespace std;
int check1(string s) {
  int p = 0;
  if (s.size() == 1) return 1;
  int mn = 999999;
  int a[26];
  int c;
  for (int k = 0; k < 26; k++) {
    a[k] = 0;
  }
  for (p = 0; p <= s.size() - 1; p++) {
    c = s[p] - 'a';
    a[c]++;
  }
  for (p = s.size(); p > 0; p--) {
    int c2 = 0;
    for (int j = 0; j < 26; j++) {
      if ((a[j] % 2) == 1) c2++;
      if (c2 > 1) break;
    }
    if (c2 <= 1) {
      if (p == s.size()) return 1;
      int r = check1(s.substr(0, p)) + check1(s.substr(p, s.size() - p));
      if (r < mn) mn = r;
    }
    c = s[p] - 'a';
    a[c]--;
  }
  return mn;
}
int main() {
  string str;
  cin >> str;
  int r = check1(str);
  cout << r << endl;
  return 0;
}
