#include <bits/stdc++.h>
using namespace std;
char s[1005];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  int best = 0;
  for (int i = (0); i < (n); ++i) {
    int act = 1;
    char C = s[i];
    int kto = i;
    for (int j = (i + 1); j < (n); ++j) {
      if ((j - kto) % 2 == 1 && s[j] == C) {
        act++;
        kto = j;
      }
    }
    best = max(act, best);
  }
  printf("%d\n", best);
}
