#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const int INF = 1000000007;
string S;
int cnt;
string now, pre;
int check_count(string s) {
  int trgt = 0;
  while (trgt < s.size()) {
    now = "";
    now += s[trgt];
    if (now != pre) {
      pre = now;
      cnt++;
      trgt++;
      continue;
    }
    if (trgt == s.size() - 1) {
      cnt--;
      break;
    }
    trgt++;
    now += s[trgt];
    if (now != pre) {
      pre = now;
      cnt++;
      trgt++;
    }
  }
  return cnt;
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> S;
  cnt = 0;
  pre = "";
  int ans1 = check_count(S);
  if (S.size() == 1) {
    cout << 1 << endl;
    return 0;
  }
  pre = "";
  pre += S[0];
  pre += S[1];
  string T = S.substr(2, S.size() - 2);
  cnt = 1;
  int ans2 = check_count(T);
  cout << max(ans1, ans2) << endl;
  return 0;
}
