#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int sum = 1;
  string s1, s2;
  s1 += s[0];
  s2 += s[1];
  for (int i = 1; i < s.length() - 1; i++) {
    if (s1 != s2) {
      s1 = s2;
      s2 = s[i + 1];
      sum++;
    } else {
      i++;
      s2 += s[i];
      sum++;
    }
  }
  cout << sum << endl;
  return 0;
}
