#include <bits/stdc++.h>

using namespace std;

int main() {
  string s;
  cin>>s;
  
  string cur;
  string last;
  int k = 0;
  for (int i = 0; i < s.size(); i++) {
    cur += s[i];
    if (cur != last) {
      last = cur;
      cur = "";
      k++;
    }
  }
  cout<<k<<endl;
}