#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
const int B = 7;
int dp[B][100009];
string s;
int rec(int x, int y) {
  if (y == s.size() - 1) return 0;
  int& ret = dp[x][y];
  if (~ret) return ret;
  ret = -1000000007;
  string a;
  for (int i = y - x; i <= y; i++) a += s[i];
  for (int j = y + 1; j < min(y + B, (int)s.size()); j++) {
    string b;
    for (int k = y + 1; k <= j; k++) b += s[k];
    if (a != b) umax(ret, rec(j - (y + 1), j) + 1);
  }
  return ret;
}
int main() {
  memset(dp, -1, sizeof dp);
  cin >> s;
  int ans = -1;
  for (int i = 0; i < min(B, (int)s.size()); i++) umax(ans, rec(i, i) + 1);
  printf("%d\n", ans);
  return 0;
}
