#include <bits/stdc++.h>
using namespace std;

int main() {
  string s;
  cin >> s;

  int k = 0;
  string before = "";
  string tmp = "";
  for (int i = 0; i < s.size(); i++) {
    tmp += s[i];
    if (tmp != before) {
      k++;
      before = tmp;
      tmp = "";
    }
  }
  cout << k << endl;


}