#include <bits/stdc++.h>
using namespace std;
int divide(const string& prev, const string& S, int cnt) {
  if (S.length() > 1) {
    string left(S.begin(), S.begin() + 1);
    string right(S.begin() + 1, S.end());
    if (prev != left && left != right) {
      return divide(left, right, cnt + 1);
    }
  }
  if (S.length() > 2) {
    string left(S.begin(), S.begin() + 2);
    string right(S.begin() + 2, S.end());
    if (prev != left && left != right) {
      return divide(left, right, cnt + 1);
    }
  }
  return cnt;
}
int main() {
  string S;
  cin >> S;
  cout << divide("", S, 0) + 1 << endl;
  return 0;
}
