#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1100;
const long long mod = 1e9 + 7;
const long long inf = 1e18;
long long n, dp[maxn], ans;
string s;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> s;
  n = s.size();
  for (long long i = n - 1; i > -1; i--) {
    dp[i] = 1;
    for (long long j = i + 1; j < n; j += 2) {
      if (s[i] == s[j]) {
        dp[i] = max(dp[i], dp[j] + 1);
      }
    }
    ans = max(ans, dp[i]);
  }
  cout << ans;
  return 0;
}
