#include <bits/stdc++.h>
using namespace std;
string s;
int main(void) {
  cin >> s;
  int n = s.size();
  int cnt = 1;
  int len = 1;
  for (int i = 2; i < n; i++) {
    if (len == 1) {
      if (s[i - 1] == s[i]) {
        if ((i + 1) != n) {
          cnt++;
        }
        len = 2;
        i++;
      } else {
        cnt++;
        len = 1;
      }
    } else {
      cnt++;
      len = 1;
    }
  }
  printf("%d\n", cnt);
  return 0;
}
