#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  cin >> str;
  int former;
  if (str[0] == str[1])
    former = 2;
  else
    former = 1;
  int res = 1;
  for (int i = former; i < str.size(); i++) {
    if (str[i] != str[i - 1]) {
      res++;
      former = 1;
    } else if (former == 2) {
      res++;
      former = 1;
    } else {
      res++;
      former = 2;
      i++;
    }
  }
  cout << res << endl;
}
