#include <bits/stdc++.h>
using namespace std;
int lenCount(string s, char c, int n) {
  int count = 2;
  for (int i = n + 2; i < s.length(); i++) {
    if (s[i] == c) count++;
  }
  return count;
}
int main() {
  string S;
  cin >> S;
  char tempc = '0';
  int count = 0;
  int length = S.length();
  for (int i = 0; i < length; i++) {
    if (tempc == S[i]) {
      if ((i + 1) < length) {
        tempc = '0';
        i++;
      }
    } else {
      tempc = S[i];
    }
    count++;
  }
  cout << count << endl;
  return 0;
}
