#include <bits/stdc++.h>
using namespace std;
int main() {
  int n = 0, k = 0, ans = 0;
  string s;
  cin >> s;
  while (k < s.length() - 1) {
    if (s[k] != s[k + 1]) {
      ans++;
      k++;
    } else {
      ans++;
      k = k + 3;
    }
  }
  if ((s.length() == 2) && s[0] == s[1]) ans = 0;
  cout << ans + 1 << endl;
  return 0;
}
