#include <bits/stdc++.h>
using namespace std;
int split(const string& s, int prev, int cur, int n) {
  if (cur >= s.size()) return n;
  if (cur - prev == 1 && s[prev] == s[cur]) {
    if (cur > s.size() - 2) return -1;
    return split(s, cur, cur + 2, n + 1);
  }
  return split(s, cur, cur + 1, n + 1);
}
int main() {
  cout << setprecision(15);
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 1; i < s.size(); ++i) {
    ans = max(ans, split(s, 0, i, 1));
  }
  cout << ans << endl;
  return 0;
}
