#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int len = s.length();
  int res = 0;
  for (int i = 0; i < len; i++) {
    int cur_res = 1;
    char searched = s[i];
    int th = 0;
    for (int j = i + 1; j < len; j++) {
      if (s[j] == searched) {
        if (th % 2 == 0) {
          cur_res++;
          th = 0;
        } else {
          th++;
        }
      } else
        th++;
    }
    if (cur_res > res) res = cur_res;
  }
  cout << res;
  return 0;
}
