#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n = s.size();
  long long ans = 0;
  for (int i = 0; i < 10; i++) {
    int j = 0, l=0;
    map<string, int> mp;
    vector<string> vec(1) = {s[0]};
    while (j < n) {
      l = j;
      while (s[j] == s[j+1] && j+1 < n) {
        string a = s.substr(l, j);
        ++(mp[a]);
        j++;
      }
      j++;
    }
    ans = max(ans, (long long)mp.size());

  }
  cout << ans << '\n';
}
