#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int ans = 1;
  string now;
  now = now + S[0];
  for (int i = 1; i < S.length(); i++) {
    if (now.length() > 1) {
      now = S[i];
      ans++;
    } else {
      if (S[i] == now[0]) {
        now = now + S[i];
        if (i == S.length() - 1) {
          ans++;
        }
      } else {
        now = S[i];
        ans++;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
