#include <bits/stdc++.h>
using namespace std;
const int inf = numeric_limits<int>::max() / 4;
const long long linf = numeric_limits<long long>::max() / 4;
const unsigned long long ulinf = numeric_limits<unsigned long long>::max() / 4;
const double pi = acos(-1);
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dx8[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
const int dy8[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
long long modpow(long long i, long long j) {
  long long tmp = 1;
  while (j) {
    if (j % 2) tmp = ((tmp * i) % (long long)(1e9 + 7));
    i = ((i * i) % (long long)(1e9 + 7));
    j /= 2;
  }
  return tmp;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
int kai(string s) {
  map<char, int> m;
  for (int i = (0); i < (int)(((int)(s).size())); i++) m[s[i]]++;
  int f = 0;
  for (auto ite : m) {
    if (ite.second % 2 == 1) {
      if (f == 1) {
        return 0;
      }
      f = 1;
    }
  }
  return 1;
}
char ki(string s) {
  map<char, int> m;
  for (int i = (0); i < (int)(((int)(s).size())); i++) m[s[i]]++;
  for (auto ite : m) {
    if (ite.second % 2 == 1) {
      return ite.first;
    }
  }
  return '!';
}
int main() {
  string s;
  cin >> s;
  s += '!';
  int cnt = 0;
  string t = "";
  vector<string> v;
  for (int i = (0); i < (int)(((int)(s).size())); i++) {
    t += s[i];
    if (kai(t) == 1 && i != ((int)(s).size()) - 1) {
    } else {
      cnt++;
      t.erase(((int)(t).size()) - 1);
      v.push_back(t);
      t = s[i];
    }
  }
  for (int i = (1); i < (int)(((int)(v).size())); i++) {
    if (((int)(v[i - 1]).size()) % 2 == 0 && ((int)(v[i]).size()) % 2 == 0) {
      v[i - 1] += v[i];
      v.erase(v.begin() + i);
      i--;
    } else if ((((int)(v[i - 1]).size()) % 2 == 0 &&
                ((int)(v[i]).size()) % 2 == 1) ||
               (((int)(v[i - 1]).size()) % 2 == 1 &&
                ((int)(v[i]).size()) % 2 == 0)) {
      v[i - 1] += v[i];
      v.erase(v.begin() + i);
      i--;
    } else if (((int)(v[i - 1]).size()) % 2 == 1 &&
               ((int)(v[i]).size()) % 2 == 1) {
      if (ki(v[i - 1]) == ki(v[i])) {
        v[i - 1] += v[i];
        v.erase(v.begin() + i);
        i--;
      }
    }
  }
  cout << (((int)(v).size())) << endl;
  return 0;
}
