#include <bits/stdc++.h>
using namespace std;
string s;
int len;
int memo[200001];
int rec(int start, string before) {
  if (start >= len) {
    return 0;
  }
  int sai = 0;
  for (int i = 1; i <= 2; i++) {
    if (memo[start + i] == 0) {
      string t = s.substr(start, i);
      if (t != before) {
        int ret = rec(start + i, t) + 1;
        if (sai < ret) {
          sai = ret;
        }
      }
    } else {
      sai = memo[start + i];
    }
  }
  return memo[start] = sai;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> s;
  len = s.length();
  cout << rec(0, "") << endl;
  return 0;
}
