#include <bits/stdc++.h>
using namespace std;
vector<int> a[26 + 5];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  for (int i = 0; i < n; i++) a[s[i] - 'A'].push_back(i);
  int res = 0;
  for (int i = 0; i < 26; i++) {
    int cur = 1;
    for (int j = 1; j < a[i].size(); j++) {
      int pos1 = a[i][j - 1], pos2 = a[i][j];
      if (pos1 % 2 != pos2 % 2) cur++;
    }
    res = max(res, cur);
  }
  cout << res << '\n';
  return 0;
}
