#include <bits/stdc++.h>
using namespace std;
string s, current;
int ans = 0, cnt = 0;
void solve(int n, string prev) {
  if (n == s.size() - 1) {
    current.push_back(s[n]);
    if (current != prev) {
      ans = max(ans, cnt + 1);
    }
    return;
  }
  current.push_back(s[n]);
  solve(n + 1, prev);
  current.pop_back();
  if (current != prev) {
    string buf = current;
    current.erase(current.begin(), current.end());
    cnt++;
    solve(n + 1, buf);
    cnt--;
    current = buf;
  }
  return;
}
int main() {
  cin >> s;
  solve(0, "NULL");
  cout << ans;
}
