#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  S.pop_back();
  int count = 1;
  int N = S.size();
  while (N > 0) {
    if (N == 1) {
      count++;
      break;
    }
    if (S.at(N - 1) != S.at(N - 2)) {
      S.pop_back();
    } else {
      S.pop_back();
      S.pop_back();
    }
    count++;
    N = S.size();
  }
  cout << count << endl;
}
