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