#include <bits/stdc++.h>
using ll = long long;
template <class T>
using vt = std::vector<T>;
using vvi = std::vector<vt<int>>;
int main() {
  std::string s;
  std::cin >> s;
  vt<std::string> S;
  int ans = 0;
  int cnt = 0;
  while (cnt < s.size()) {
    std::string p, q;
    p += s[cnt];
    S.push_back(p);
    int tmp = cnt;
    for (int i = cnt + 1; i < s.size(); ++i) {
      q += s[i];
      if (S[tmp] != q) {
        S.push_back(q);
        q.clear();
        ++tmp;
      }
    }
    if (S.size() > ans) ans = S.size();
    ++cnt;
    S.clear();
    q.clear();
  }
  std::cout << ans << '\n';
  return 0;
}
