#include <bits/stdc++.h>
using namespace std;
const long long inf = 2e18 + 7;
const long long mod = 1e9 + 7;
const double eps = 1e-9;
const double PI = 2 * acos(0.0);
const double E = 2.71828;
char s[100005];
int f[26][2];
int main(void) {
  gets(s);
  int res = 0;
  for (int i = 0; s[i]; ++i) {
    int now = s[i] - 'A';
    f[now][i % 2] = f[now][(i + 1) % 2] + 1;
    res = max(res, f[now][i % 2]);
  }
  printf("%d\n", res);
  return 0;
}
