#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  int cnt = 1;
  char p = s.at(0);
  bool b = false;
  for (int i = 1; i < n; i++) {
    cnt++;
    char c = s.at(i);
    if (b)
      b = false;
    else if (c == p) {
      i++;
      b = true;
    }
    p = c;
  }
  if (n > 1 && (s.at(n - 2) == s.at(n - 1))) cnt--;
  cout << cnt << endl;
}
