#include <bits/stdc++.h>
using namespace std;
int main() {
  int count = 1, ans = 1;
  char c;
  string S;
  cin >> S;
  vector<int> V;
  c = S[0];
  for (int i = 1; i < S.size(); i++) {
    if (c != S[i] || count == 2) {
      ans++;
      count = 1;
      c = S[i];
    } else {
      if (i == S.size() - 1) break;
      i++;
      count = 2;
      ans++;
    }
  }
  cout << ans << endl;
}
