#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  vector<char> v;
  int n = s.size();
  for (int i = 0; i < n; i++) {
    char t = s[i];
    if (s[i] != v.back()) {
      v.push_back(t);
    } else {
      if (i = n - 1) continue;
      t = t + s[i + 1];
      v.push_back(t);
      i++;
    }
  }
  cout << v.size() << endl;
  return 0;
}
