#include <bits/stdc++.h>
using namespace std;
signed main() {
  string s;
  cin >> s;
  long long n = s.size();
  char vis[n];
  long long res = 0;
  for (long long i = 1; i < n; i++) {
    res++;
    if (s[i] == s[i - 1] && vis[i - 1]) {
      if (i == n) --res;
      ++i;
    }
  }
  cout << res++ << endl;
  return 0;
}
