#include <bits/stdc++.h>
using namespace std;
map<char, int> diff(map<char, int> a, map<char, int> b) {
  map<char, int> ret;
  for (char i = 'a'; i <= 'z'; i++) {
    if (a[i] - b[i] == 0) continue;
    ret[i] = a[i] - b[i];
  }
  return ret;
}
bool valid(int l, int r, vector<map<char, int>> &hist) {
  map<char, int> h = diff(hist[r], hist[l]);
  int odd_count = 0;
  ;
  for (auto e : h)
    if (e.second % 2) odd_count++;
  if (odd_count <= 1)
    return true;
  else
    return false;
}
string s;
int dp[200000];
int main() {
  cin >> s;
  vector<map<char, int>> hist(s.size() + 1);
  for (long long i = 0; i < (long long)(s.size()); i++) {
    hist[i + 1] = hist[i];
    hist[i + 1][s[i]]++;
  }
  map<char, set<int>> pos;
  for (long long i = 0; i < (long long)(s.size()); i++) {
    pos[s[i]].insert(i);
  }
  for (char i = 'a'; i <= 'z'; i++)
    pos[i].insert(s.size()), pos[i].insert(s.size());
  for (long long i = 0; i < (long long)(200000); i++) dp[i] = (1e9 + 1);
  dp[0] = 0;
  for (long long i = 0; i < (long long)(s.size()); i++) {
    for (char j = 'a'; j <= 'z'; j++) {
      int p = *(pos[j].lower_bound(i));
      if (p >= s.size()) continue;
      if (valid(p, i, hist)) dp[p + 1] = min(dp[p + 1], dp[i] + 1);
      p = *(++pos[j].lower_bound(i));
      if (p >= s.size()) continue;
      if (valid(p, i, hist)) dp[p + 1] = min(dp[p + 1], dp[i] + 1);
    }
  }
  cout << dp[s.size()] << endl;
}
