#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-5;
const long long INF = (long long)(1e9) * (long long)(1e9);
template <class T>
void chmin(T& a, const T& b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T& a, const T& b) {
  if (a < b) a = b;
}
const long long pow(const long long p, const long long q) {
  long long t = 1;
  for (int i = (0); i < (int)(q); ++i) t *= p;
  return t;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  int n = s.size();
  vector<vector<char>> let(n + 1, vector<char>(26));
  vector<pair<vector<char>, int>> li(n + 1);
  vector<char> tlet(26);
  for (int i = (0); i < (int)(n); ++i) {
    tlet[s[i] - 'a'] = 1 - tlet[s[i] - 'a'];
    let[i + 1] = tlet;
    li[i + 1] = pair<vector<char>, int>(tlet, i + 1);
  }
  sort(li.begin(), li.end());
  int inf = 1e9;
  vector<int> memo(n + 1, inf);
  memo[0] = 0;
  for (int i = 0; i < n; i++) {
    vector<char> s = let[i];
    for (int j = (0); j < (int)(27); ++j) {
      if (j != 26) s[j] = 1 - s[j];
      auto p =
          lower_bound(li.begin(), li.end(), pair<vector<char>, int>(s, -1));
      while ((*p).first == s) {
        chmin(memo[(*p).second], memo[i] + 1);
        p++;
      }
      if (j != 26) s[j] = 1 - s[j];
    }
  }
  cout << memo[n] << endl;
}
