#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  string prev = "";
  string buff = "";
  long l = 0;
  long cnt = 0;
  cin >> S;
  prev = S[0];
  buff = S[0];
  for (long l = 1; l < S.size(); l++) {
    buff += S[l];
    if (prev.compare(buff) == 0) {
    } else {
      prev = buff;
      buff = "";
      cnt++;
    }
  }
  cout << cnt << endl;
}
