#include <bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
int main() {
  string S;
  cin >> S;
  int L = S.size();
  char last = '0';
  int i = 0, K = 0;
  for (int i = 0; i < L; i++) {
    char s = S[i];
    if (last == s) {
      s = '0', i++;
    }
    last = s;
    K++;
  }
  if (L > 1 && S[L - 1] == S[L - 2]) K--;
  cout << K << endl;
}
