#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  int k = 1;
  cin >> S;
  string sub;
  string next;
  sub += S[0];
  for (int i = 1; i < S.size(); i++) {
    next = S[i];
    while ((next.size() == sub.size()) && next == sub) {
      i++;
      next += S[i];
    }
    sub = next;
    next = "";
    k++;
  }
  cout << k << endl;
}
