#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string s;
  int k;
  int len, count = 1;
  cin >> s;
  len = s.length();
  for (int i = 1; i < len; i++) {
    if (s[i - 1] == s[i]) {
      i++;
      if (i == len - 1) count++;
    }
    count++;
  }
  cout << count << "\n" << endl;
  return 0;
}
