#include <bits/stdc++.h>

using namespace std;

int main() {
  string s;
  cin >> s;
  
  int n = s.size();
  string pre, cur = "";
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    cur += s[i];
    if (cur == pre) continue;
    pre = cur;
    cur = "";
    ans++;
  }
  cout << ans << endl;
  return 0;
}