#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = (int)S.size();
  char now;
  int K = 1;
  for (int i = 0; i < N - 1;) {
    now = S.at(i);
    if (now == S.at(i + 1)) {
      K += 2;
      i += 3;
      if (i >= N) {
        K -= 2;
      }
    } else {
      K += 1;
      i += 1;
    }
  }
  cout << K << endl;
  return 0;
}
