#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265358979323846;
const long long dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const long long dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
string S;
long long dp[220000][5];
long long dfs(long long idx, long long n) {
  if (idx + n == S.length()) return 1;
  if (dp[idx][n] != -1) return dp[idx][n];
  long long ret = 0;
  for (long long i = 1; i < 5; i++) {
    if (idx + n + i > S.length()) continue;
    if (S.substr(idx, n) == S.substr(idx + n, i)) continue;
    ret = max(ret, dfs(idx + n, i) + 1);
  }
  return dp[idx][n] = ret;
}
signed main() {
  cin >> S;
  long long ans = 0;
  for (long long i = 0; i < 220000; i++)
    for (long long j = 0; j < 11; j++) dp[i][j] = -1;
  for (long long i = 1; i < 5; i++) ans = max(ans, dfs(0, i));
  cout << ans << endl;
}
