#include <bits/stdc++.h>
using namespace std;
int main() {
  string x;
  cin >> x;
  int i, j, sum, max = 1;
  for (i = 0; i < x.size(); i++) {
    sum = 1;
    if (x[i] != '?') {
      for (j = i + 1; j < x.size(); j += 2) {
        if (x[j] == x[i]) {
          sum++;
          x[j] = '?';
          j--;
        }
      }
    }
    if (sum > max) max = sum;
  }
  cout << max << endl;
  return 0;
}
