#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  string s;
  cin >> s;
  int ans(1);
  int length(1);
  for (int i = 1; i < s.size(); i++) {
    if (s[i + 1] != s[i]) {
      ans++;
      length = 1;
    } else {
      if (length == 2) {
        ans++;
        length = 1;
      } else {
        length = 2;
        continue;
      }
    }
  }
  cout << ans << endl;
}
