#include <bits/stdc++.h>
using namespace std;
const int delta = (int)1e9 + 7;
string s;
map<char, int> p;
int ans;
vector<int> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  for (int i = 0; i < s.size(); ++i) {
    ++p[s[i]];
    if (p[s[i]] & 1) {
      ++ans;
      if (v.size() >= 2)
        for (int j = v[v.size() - 2]; j <= v[v.size() - 1]; ++j) --p[s[j]];
      v.push_back(i);
    } else {
      --ans;
      v.pop_back();
      v.pop_back();
    }
  }
  ans = max(ans, 1);
  cout << ans;
  return cout << endl, 0;
}
