#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  string s;
  cin >> s;
  int cnt = 1;
  string tmp;
  tmp += s[0];
  int i = 1;
  while (i < s.size()) {
    if (s[i] == tmp[0]) {
      tmp = s[i] + s[i + 1];
      i += 2;
    } else {
      tmp = s[i];
      i++;
    }
    cnt++;
  }
  if (s[-1] == s[-2]) cnt--;
  cout << cnt << endl;
  return 0;
}
