#include <bits/stdc++.h>
using namespace std;

int main() {
  string s; cin >> s;
  char prev = s[0];
  int ans = s.size();
  for (int i=1; i<s.size(); i++) {
    char curr = s[i];
    if (prev==curr) {
      i++;
      ans--;
      prev = '0';
    } else {
      prev = curr;
    }
  }
  cout << ans << endl;
  return 0;
}