#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int cnt = 0;
  int lon = 2;
  char c;
  for (int i = 0; i < s.size(); i++) {
    if (lon == 2 || s[i] != c) {
      lon = 1;
      c = s[i];
      cnt++;
      continue;
    } else {
      cnt++;
      lon = 2;
      i++;
    }
  }
  cout << cnt << endl;
  return 0;
}
