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