#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int ans = 0;
  int pre = 0;
  int sz = 0;
  for (int i = (1); i < (n); i++) {
    if (sz == 1 && s[pre] == s[i]) {
      pre = i;
      i++;
      sz = 2;
    } else {
      pre = i;
      sz = 1;
    }
    ans++;
  }
  cout << ans << endl;
  return 0;
}
