#include <bits/stdc++.h>
using namespace std;
string s;
signed main() {
  cin >> s;
  long long ans = s.size();
  for (long long i = 0; i <= s.size() - 3; i++) {
    if (s[i] == s[i + 1]) {
      ans--;
      i += 2;
    }
    if (s[i + 1] == s[i + 2]) {
      ans--;
      i += 2;
    }
  }
  cout << ans << endl;
}
