#include <bits/stdc++.h>
using namespace std;
vector<int> v[200];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int ans = 0;
  for (int i = 0; i < s.size(); i++) {
    v[s[i]].push_back(i);
  }
  int x, m;
  for (int i = 'A'; i <= 'Z'; i++) {
    m = 0;
    x = 0;
    for (auto u : v[i]) {
      if (u % 2 == m) {
        x++;
        m = 1 - m;
      }
    }
    ans = max(ans, x);
    m = 1;
    x = 0;
    for (auto u : v[i]) {
      if (u % 2 == m) {
        x++;
        m = 1 - m;
      }
    }
    ans = max(ans, x);
  }
  cout << ans;
}
