#include <bits/stdc++.h>
using namespace std;
int main(void) {
  string S;
  cin >> S;
  long ans = 1;
  bool flag = false;
  for (long i = 1; i < S.length(); i++) {
    if (S[i] == S[i - 1] && !flag) {
      i += 1;
      flag = true;
    } else
      flag = false;
    ans += 1;
  }
  cout << ans << endl;
  return 0;
}
