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