#include <bits/stdc++.h>
using namespace std;
int ans;
string s;
vector<char> v;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  for (int i = 0; i < 26; i++) v.push_back(i + 'A');
  for (int i = 0; i < 26; i++) {
    int tmp = -1, cnt = 1;
    for (int j = 0; j < s.size(); j++) {
      if (s[j] == v[i]) {
        if (tmp == -1)
          tmp = j;
        else if ((j - tmp) % 2) {
          cnt++;
          tmp = j;
        }
      }
    }
    ans = max(ans, cnt);
  }
  cout << ans;
  return 0;
}
