#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int count_do(const string& S) {
  string before, after;
  before += S[0];
  ll count = 1;
  for (ll i = 1; i < S.length();) {
    do {
      after += S[i];
      i++;
      if (i == S.length()) {
        return count;
      }
    } while (before == after);
    count++;
    before = after;
    after.clear();
  }
  return count;
}
int main() {
  string S;
  cin >> S;
  ll ans1 = count_do(S);
  reverse(begin(S), end(S));
  ll ans2 = count_do(S);
  cout << max(ans1, ans2) << endl;
  return 0;
}
