#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int N = S.size();
  int ans = 1;
  int cur = 0;
  string prev, now;
  while (cur < N) {
    now += S[cur];
    if (prev != now) {
      ++ans;
      prev = now;
      now = "";
    } else {
      ++cur;
    }
    ++cur;
  }
  cout << ans << endl;
}
