#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int cnt = 0;
  string lastCmp = "" + S[0];
  string curCmp = "";
  for (int i = 1; i < ((int)(S).size()); i++) {
    curCmp += S[i];
    if (curCmp != lastCmp) {
      cnt++;
      lastCmp = curCmp;
      curCmp = "";
    }
  }
  cout << cnt << endl;
  return 0;
}
