#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<string> v;
  v.push_back(s.substr(0, 1));
  int cnt(1);
  int last_length(1);
  while (cnt < s.length()) {
    for (int i(0); i < (s.length() - cnt); ++i) {
      if (i == (s.length() - cnt - 1) && s.substr(cnt, i + 1) == v.back()) {
        v.pop_back();
        cnt -= last_length;
        i = last_length;
        last_length = v.back().length();
      }
      if (s.substr(cnt, i + 1) != v.back()) {
        v.push_back(s.substr(cnt, i + 1));
        cnt += i + 1;
        last_length = i + 1;
        break;
      } else
        continue;
    }
  }
  cout << v.size() << endl;
  return 0;
}
