#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);
string s;
map<pair<int, string>, int> memo;
int ans;
int solve(int pos, string last) {
  auto key = make_pair(pos, last);
  if (memo.find(key) != memo.end()) return memo[key];
  if (pos == s.size()) return memo[key] = 0;
  int ret = -1;
  for (int i = 1; (pos + i) <= s.size(); ++i) {
    int next_pos = pos + i;
    if (last == s.substr(pos, i)) continue;
    ret = max(ret, solve(next_pos, s.substr(pos, i)));
  }
  ret += (ret == -1) ? 0 : 1;
  return memo[key] = ret;
}
int main(void) {
  cin >> s;
  set<string> occur;
  ans = solve(0, "");
  printf("%d\n", ans);
  return 0;
}
