#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int max(0);
  for (int k(1); k < (s.length() - 1); k++) {
    vector<string> v;
    v.push_back(s.substr(0, k));
    int cnt(k);
    int last_length(k);
    while (cnt < s.length()) {
      for (int i(0); i < (s.length() - cnt); ++i) {
        if (i == (s.length() - cnt - 1) && s.substr(cnt, i + 1) == v.back()) {
          v.pop_back();
          cnt -= last_length;
          i = last_length;
          last_length = v.back().length();
        }
        if (s.substr(cnt, i + 1) != v.back()) {
          v.push_back(s.substr(cnt, i + 1));
          cnt += i + 1;
          last_length = i + 1;
          break;
        } else
          continue;
      }
    }
    if (v.size() > max) max = v.size();
  }
  cout << max << endl;
  return 0;
}
