#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  string S;
  int i = 0;
  int j = 1;
  cin >> S;
  N = S.size();
  while (i < N - 1) {
    if (S[i] == S[i + 1]) {
      i += 2;
      j++;
    }
    i++;
    j++;
  }
  if (N > 2 && S[N - 3] != S[N - 2] && S[N - 2] == S[N - 1]) j -= 2;
  cout << j << endl;
  return 0;
}
