#include <bits/stdc++.h>
using namespace std;
int main() {
  string s, pre = "", cur = "";
  cin >> s;
  int l = s.length(), i = 1, cnt = 1;
  pre = s[0];
  while (i < l) {
    cur += s[i++];
    if (cur[0] == s[i]) {
      if (i == l - 1)
        cnt--;
      else
        cur += s[i++];
    }
    cur += s[i++];
    pre = cur;
    cur = "";
    cnt++;
  }
  cout << cnt;
  return 0;
}
