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