#include <bits/stdc++.h>
using namespace std;
void check(string str, string bef, int count, int &max);
int main() {
  string str;
  int max = -1;
  int i;
  cin >> str;
  max = -1;
  check(str, "", 0, max);
  cout << max << endl;
  return 0;
}
void check(string str, string bef, int count, int &max) {
  int i;
  if (str.length() == 0) {
    if (max == -1 || max < count) {
      max = count;
    }
    return;
  }
  string temp;
  for (i = 0; i < str.length(); i++) {
    temp = str.substr(0, i + 1);
    if (temp != bef) {
      check(str.substr(i + 1), temp, count + 1, max);
    }
  }
}
