#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = (int)s.size();
  const int K = 10;
  vector<vector<int>> dp(n + 1, vector<int>(K + 1, -1));
  dp[0][0] = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= K; j++) {
      if (dp[i][j] == -1) {
        continue;
      }
      for (int k = 1; k <= K && i + k <= n; k++) {
        if (s.substr(i - j, j) != s.substr(i, k)) {
          dp[i + k][k] = max(dp[i + k][k], dp[i][j] + 1);
        }
      }
    }
  }
  int ans = 0;
  for (int j = 0; j <= K; j++) {
    ans = max(ans, dp[n][j]);
  }
  cout << ans << '\n';
  return 0;
}
