#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main(void) {
  string s;
  cin >> s;
  string sub;
  ll ans = 1;
  ll i = 0;
  sub = s[i];
  while (1) {
    if (((ll)(s).size()) - 2 < i) break;
    if (sub != s.substr(i, 1)) {
      ans++;
      sub = s.substr(i, 1);
      i += 1;
    } else if (sub != s.substr(i, 2)) {
      ans++;
      sub = s.substr(i, 2);
      i += 2;
    }
  }
  if (i == ((ll)(s).size()) - 1 && sub == s.substr(i, 1)) ans++;
  cout << ans;
  return 0;
}
