#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  string s;
  cin >> s;
  long long cnt = 1;
  long long prev = 1;
  long long n = s.size();
  for (long long i = 1; i < n; i++) {
    if (prev == 2) {
      cnt++;
      prev = 1;
    } else if (s[i] == s[i - 1] && i + 1 < n) {
      cnt++;
      i++;
    } else {
      cnt++;
    }
  }
  cout << cnt;
  return 0;
}
