#include <bits/stdc++.h>
using namespace std;
signed main() {
  string s;
  cin >> s;
  int n = s.length();
  int K = n;
  bool f = true;
  for (int i = 0; i < n - 1; i++) {
    if (f) {
      f = false;
      continue;
    }
    if (s[i] == s[i + 1]) {
      f = true;
      K--;
    }
  }
  cout << K << endl;
}
