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