#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
int main() {
  string S;
  cin >> S;
  int ans = 1;
  char now = S.at(0);
  bool flag = false;
  for (int i = 1; i < S.size(); i++) {
    if (flag) {
      flag = false;
      now = S.at(i);
      ans++;
    } else {
      if (now == S.at(i)) {
        flag = true;
        ans++;
        i++;
      } else {
        flag = false;
        now = S.at(i);
        ans++;
      }
    }
  }
  if (flag = true && S.at(S.size() - 2) == S.at(S.size() - 1)) ans--;
  cout << ans << endl;
  return 0;
}
