#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int ans = 0;
  string str = "";
  str += s[0];
  for (int i = 1; i < s.size() - 1; i++) {
    string tmp = "";
    tmp += s[i];
    if (str == tmp) {
      str = (tmp + s[i + 1]);
      i++;
    } else {
      str = tmp;
    }
    ans++;
  }
  if (s.size() > 1 && str.size() < 2) {
    if (s[s.size() - 1] != s[s.size() - 2]) ans++;
  }
  cout << ans + 1 << endl;
  return 0;
}
