#include <bits/stdc++.h>
using namespace std;
int main () {
  string S, T = "";
  cin >> S;
  int front = 0, count = 0;;
  for(int i = 0; i < S.size(); i++){
    if(T != S.substr(front, i + 1 - front)){
      count++;
      T = S.substr(front, i + 1 - front);
      front = i + 1;
    }
  }
  cout << count << endl;
  return 0;
}