#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int ans = 1;
  int flag = 0;
  string Spre, Snow, Snext;
  Snow = S.at(0);
  int i = 0;
  for (int i = 0; i < S.size() - 1; i++) {
    Snext = S.at(i + 1);
    if ((Snow != Snext) && (flag == 2)) {
      Snow = Snow + Snext;
      flag = 0;
    } else if ((Snow != Snext) && (flag == 1)) {
      ans++;
      Snow = Snext;
    } else if ((Snow == Snext) && (flag == 1)) {
      ans++;
      Snow = Snext;
      flag = 2;
    } else if ((Snow == Snext) && (flag == 0)) {
      Snow = Snow + Snext;
      flag = 1;
    } else {
      ans++;
      Snow = Snext;
    }
  }
  cout << ans << endl;
  return 0;
}
