#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int len = s.length(), l = 1;
  int ans = 0;
  for (int i = 1; i < len; i++) {
    if (l == 2) {
      l = 1;
    } else {
      if (s[i - 1] == s[i]) {
        l++;
        i++;
      }
    }
    ans++;
  }
  if (l == 1) ans++;
  cout << ans << endl;
  return 0;
}
