#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<string> ans;
  int j = 0;
  string t = "" + s[0];
  ans.emplace_back(t);
  for (int i = 1; i < s.length(); i++) {
    t = "" + s[i];
    if (ans[j] == t) {
      if (i == s.length() - 1) {
        ans[j] += s[i];
      } else {
        i++;
        t += s[i + 1];
        j++;
        ans.emplace_back(t);
      }
    } else {
      j++;
      ans.emplace_back(t);
    }
  }
  cout << ans.size() << endl;
  return 0;
}
