#include <bits/stdc++.h>
using namespace std;
const int CN = 2e5 + 5;
char ch[CN];
int n, ans = 0;
int f[CN];
bool exm(int cl, int cr, int pl, int pr) {
  if ((pr - pl + 1) != (cr - cl + 1)) return true;
  for (int i = 0; i < (pr - pl + 1); i++)
    if (ch[cl + i] != ch[pl + i]) return true;
  return false;
}
void dfs(int st, int k, int pl, int pr) {
  if (st > n) return (void)(ans = max(ans, k));
  if (exm(st, st, pl, pr)) dfs(st + 1, k + 1, st, st);
  if (exm(st, st + 1, pl, pr) && st + 1 <= n) dfs(st + 2, k + 1, st, st + 1);
}
int main() {
  cin >> ch;
  n = strlen(ch) - 1;
  dfs(0, 0, 1, 0);
  printf("%d", ans);
  return 0;
}
