#include <bits/stdc++.h>

using namespace std;

int main() {
  string s; cin >> s;
  int n = s.size();
  string last = "";
  string now = "";

  int ans = 0;
  for (int i = 0; i < n; ++i) {
    now += s[i];
    if (now != last) {
      last = now;
      now = "";
      ans += 1;
    }
  }
  cout << ans << endl;
  return 0;
}
