#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 vctoi(vector<char>& c) {
  int t = 0;
  for (int i = (0); i < (int)(26); ++i) {
    if (c[i]) t += (1 << i);
  }
  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<int, 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<int, int>(vctoi(tlet), i + 1);
  }
  sort(li.begin(), li.end());
  int inf = 1e9;
  vector<int> memo(n + 1, inf);
  memo[0] = 0;
  queue<pair<int, int>> ev;
  vector<int> evaluated(n + 1, 0);
  evaluated[0] = -1;
  ev.push(pair<int, int>(0, 0));
  while (!ev.empty()) {
    int i, cnt;
    tie(i, cnt) = ev.front();
    ev.pop();
    if (evaluated[i] >= cnt) continue;
    evaluated[i] = cnt;
    vector<char> s = let[i];
    for (int j = (0); j < (int)(27); ++j) {
      if (j != 26) s[j] = 1 - s[j];
      int si = vctoi(s);
      auto p = lower_bound(li.begin(), li.end(), pair<int, int>(si, -1));
      while ((*p).first == si) {
        if (memo[(*p).second] > memo[i] + 1) {
          memo[(*p).second] = memo[i] + 1;
          ev.push(pair<int, int>((*p).second, memo[i] + 1));
        }
        p++;
      }
      if (j != 26) s[j] = 1 - s[j];
    }
  }
  cout << memo[n] << endl;
}
