#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int cnt = 1;
  string tmp;
  tmp += S.at(0);
  for (int i = 1; i < S.size(); i++) {
    int j = 1;
    while (tmp == S.substr(i, j)) j++;
    tmp = S.substr(i, j);
    cnt++;
    i += j - 1;
  }
  cout << cnt << "\n";
}
