#include <bits/stdc++.h>
using namespace std;
map<string, long long> dp;
string ori;
long long recur(string s, string t) {
  if (s.length() == 1) {
    return (s != t);
  }
  long long n = s.length();
  long long ans = 0;
  for (long long i = 0; i < n - 1; i++) {
    string l = s.substr(0, i + 1);
    if (l != t) {
      string r = s.substr(i + 1);
      long long here = 1 + recur(r, l);
      ans = max(ans, here);
    }
  }
  return ans;
}
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s;
  cin >> s;
  ori = s;
  string t;
  t = "";
  cout << recur(s, t) << endl;
  return 0;
}
