#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int K = 0;
  int f = 0, s = 1;
  while (true) {
    if (f == S.length() - 1) {
      K++;
      break;
    }
    if (S[f] == S[f + 1]) {
      if (f + 1 == S.length() - 1) {
        K++;
        break;
      } else {
        K++;
        f += 2;
        K++;
        f++;
      }
    } else {
      K++;
      f++;
    }
  }
  cout << K << endl;
  return 0;
}
