#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int k, i, j;
  i = 0;
  k = 0;
  j = 0;
  while (i < s.size()) {
    if (s[i] == s[i + 1] && j == 0) {
      i += 2;
      k++;
      j = 1;
    } else if (s[i] == s[i + 1] && j == 1) {
      i++;
      k++;
      j = 0;
    } else {
      i++;
      k++;
    }
  }
  cout << k << endl;
  return 0;
}
