#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double EPS = 1e-8;
const double PI = acos(-1);
int dp[1001];
int main() {
  string s;
  while (cin >> s) {
    reverse((s).begin(), (s).end());
    int n = s.size();
    for (int i = 0; i < (int)n; ++i) dp[i] = 1;
    for (int i = 0; i < (int)n; ++i) {
      for (int j = i + 1; j < n; ++j) {
        if (s[i] == s[j]) {
          if ((j - i) % 2 == 1) {
            (dp[j] < (dp[i] + 1) ? (dp[j] = dp[i] + 1, 1) : 0);
          }
        }
      }
    }
    cout << *max_element(dp, dp + n) << endl;
  }
}
