#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
int main() {
  string s;
  cin >> s;
  function<ll(string, string)> solve = [&](string str, string last) {
    if (str.length() == 0) return 0ll;
    bool found = false;
    ll m = 0;
    for (ll i = 0; i < (ll)str.length(); ++i) {
      if (str.substr(0, i + 1) == last) continue;
      ll count = 1 + solve(str.substr(i + 1), str.substr(0, i + 1));
      m = max(m, count);
      found = true;
    }
    if (!found) return 0ll;
    return m;
  };
  cout << solve(s, "") << endl;
}
