#include <bits/stdc++.h>
using namespace std;
int INT_MAX_VAL = (int)1e20;
int INT_MIN_VAL = (int)-1e20;
long long LONG_MAX_VAL = (long long)1e20;
long long LONG_MIN_VAL = (long long)-1e20;
long long dp[1005];
int main() {
  string s;
  cin >> s;
  long long res = 0;
  for (long long(i) = 0LL; (i) < ((long long)s.size()); (i)++) {
    dp[i] = 1;
    for (int j = i - 1; j >= 0; j -= 2) {
      if (s[i] == s[j]) dp[i] = max(dp[i], dp[j] + 1);
    }
    res = max(res, dp[i]);
  }
  cout << res << '\n';
  return 0;
}
