#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  unordered_map<char, int> mp;
  int ans = 1;
  for (int i = 0; i < s.length(); i++) {
    if (mp[s[i]] == -1) continue;
    char c = s[i];
    int j = i + 1, best = 1, d = 0;
    while (j < s.length()) {
      if (s[j] == c && d % 2 == 0) best++, d = -1;
      d++;
      j++;
    }
    ans = max(ans, best);
    mp[c] = -1;
  }
  cout << ans << "\n";
  return 0;
}
