#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 6;
const long long inf = 1e18;
int n;
string s;
int dp[MAX];
int dfs(int i, string prev) {
  if (i >= n - 1) return 0;
  string t = "";
  int mx = 0;
  int p = 0;
  if (dp[i]) return dp[i];
  for (int j = i + 1; j < s.size(); j++) {
    t = t + s[j];
    if (t != prev) p = dfs(j, t) + 1;
    mx = max(mx, p);
  }
  return dp[i] = mx;
}
int main() {
  cin >> s;
  int k = 0;
  n = s.size();
  string t = "";
  memset(dp, 0, sizeof(dp));
  cout << dfs(0, t);
}
