#include <bits/stdc++.h>
using namespace std;
int32_t divide_str(string const& str, int32_t const i, int32_t const j,
                   unordered_map<int64_t, int32_t>& memo) {
  if (j >= int32_t(str.size())) {
    return 0;
  }
  auto it = memo.find((uint64_t(uint32_t(i)) << 32) + uint32_t(j));
  if (it != memo.end()) {
    return it->second;
  }
  int32_t k = numeric_limits<int32_t>::min();
  for (int32_t n = 1; n <= int32_t(str.size()) - j; ++n) {
    if (n == j - i && str.compare(i, j - i, str, j, n) == 0) {
      continue;
    }
    k = max(k, 1 + divide_str(str, j, j + n, memo));
  }
  memo[(uint64_t(uint32_t(i)) << 32) + uint32_t(j)] = k;
  return k;
}
int main() {
  string str;
  cin >> str;
  unordered_map<int64_t, int32_t> memo;
  cout << divide_str(str, 0, 0, memo) << endl;
}
