#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;
}
int main() {
  string s;
  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);
  }
  int ans = 0;
  int ind = 0;
  while (ind != s.size()) {
    ans++;
    int right = -1;
    map<char, int> h = diff(hist[s.size()], hist[ind]);
    int odd_count = 0;
    for (auto e : h)
      if (e.second % 2) odd_count++;
    if (odd_count <= 1) {
      ind = s.size();
      break;
    }
    for (char i = 'a'; i <= 'z'; i++) {
      if (h[i] == 0) continue;
      if (h[i] % 2) {
        int p = *(--pos[i].end());
        if (valid(ind, p, hist)) {
          right = max(right, p);
        }
      } else {
        int p = *(prev(pos[i].end(), 2));
        if (valid(ind, p, hist)) {
          right = max(right, p);
        }
      }
    }
    assert(right != -1);
    ind = right;
  }
  cout << ans << endl;
}
