#include <bits/stdc++.h>
using namespace std;
void _dbg(string) { cout << endl; }
template <class H, class... T>
void _dbg(string s, H h, T... t) {
  int l = s.find(',');
  cout << s.substr(0, l) << " = " << h << ", ";
  _dbg(s.substr(l + 1), t...);
}
template <class T, class U>
ostream &operator<<(ostream &o, const pair<T, U> &p) {
  o << "(" << p.first << "," << p.second << ")";
  return o;
}
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v) {
  o << "[";
  for (T t : v) {
    o << t << ",";
  }
  o << "]";
  return o;
}
int solve() {
  string s;
  cin >> s;
  int n = s.size();
  vector<int> cnt(26, 0);
  vector<int> v(n + 1, 0);
  for (int i = (int)(0); i < (int)(n); i++) {
    int c = s[i] - 'a';
    cnt[c]++;
    v[i + 1] = v[i];
    if (cnt[c] % 2 == 1)
      v[i + 1]++;
    else
      v[i + 1]--;
  }
  vector<vector<int>> pos(30);
  for (int i = (int)(0); i < (int)(n); i++) pos[v[i + 1]].push_back((i + 1));
  int p = 0;
  int ans = 0;
  while (p < n) {
    int nx = p + 1;
    for (int d = -1; d <= 1; d++)
      if (v[p] + d >= 0 && pos[v[p] + d].size() > 0)
        nx = max(nx, pos[v[p] + d].back());
    ans++;
    p = nx;
  }
  return ans;
}
int main() {
  cout << solve() << endl;
  return 0;
}
