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