#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int n = s.size();
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  int idx = 0, cnt = 1, ans = 0;
  string bef = s.substr(0, 1);
  idx = 1;
  while (idx < n) {
    if (bef == s.substr(idx, 1)) {
      if (idx + 1 == n)
        break;
      else {
        bef = s.substr(idx, 2);
        idx += 2;
        cnt++;
      }
    } else {
      bef = s.substr(idx, 1);
      idx += 1;
      cnt++;
    }
  }
  if (idx == n) ans = cnt;
  cnt = 1;
  idx = 2;
  bef = s.substr(0, 2);
  while (idx < n) {
    if (bef == s.substr(idx, 1)) {
      if (idx + 1 == n)
        break;
      else {
        bef = s.substr(idx, 2);
        idx += 2;
        cnt++;
      }
    } else {
      bef = s.substr(idx, 1);
      idx += 1;
      cnt++;
    }
  }
  if (idx == n) ans = max(ans, cnt);
  cout << ans << endl;
}
