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