#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
string S;
int main() {
  cin >> S;
  long long ans = 0;
  bool prev_one = false;
  for (int i = 0; i < (S.size()); ++i) {
    if (i == S.size() - 2 && S[i] == S[i + 1]) {
      ans++;
      break;
    }
    if (prev_one && S[i] == S[i + 1]) {
      i++;
      ans++;
      prev_one = false;
    } else {
      ans++;
      prev_one = true;
    }
  }
  cout << ans << endl;
}
