#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;
int main() {
  string s, bs = "";
  char bc = ' ';
  cin >> s;
  int cnt = 0, tmpcnt = 1;
  for (int i = 0; i < (int)(s.size()); i++) {
    if (bc != s[i]) {
      bc = s[i];
      cnt++;
    } else {
      if ((s.size() - i) <= 2) i++, cnt++;
      bc = ' ';
    }
  }
  cout << cnt << endl;
  return 0;
}
