#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int i, n, a[200] = {0}, bj[200050] = {0}, tmp1 = 0, ans = 0;
  while (1) {
    bj[tmp1] = 1;
    a[s[tmp1]]++;
    for (i = tmp1 + 1; i < s.length(); i++) {
      a[s[i]]++;
      if (a[s[i]] % 2 == 0)
        bj[i] = bj[i - 1] - 1;
      else
        bj[i] = bj[i - 1] + 1;
    }
    if (bj[s.length() - 1] == 0 && ans == 0) {
      cout << "1" << endl;
      return 0;
    }
    for (i = s.length(); i >= 0; i--) {
      if (bj[i] == 1) {
        tmp1 = i + 1;
        ans++;
        break;
      }
    }
    if (tmp1 == s.length()) break;
    for (i = 0; i < s.length() + 10; i++) bj[i] = 0;
  }
  cout << ans << endl;
  return 0;
}
