#include <bits/stdc++.h>
using namespace std;
void check(string str, string *split, int num_of_split, int count, int &max);
int main() {
  string str;
  string *split;
  int max = -1;
  int i;
  cin >> str;
  split = new string[str.length()];
  max = -1;
  check(str, split, 0, 0, max);
  cout << max << endl;
  return 0;
}
void check(string str, string *split, int num_of_split, int count, int &max) {
  int i;
  int j;
  int temp_num = num_of_split;
  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);
    for (j = 0; j < num_of_split; j++) {
      if (split[j] == temp) {
        break;
      }
    }
    if (j == num_of_split) {
      split[num_of_split] = temp;
      check(str.substr(i + 1), split, num_of_split + 1, count + 1, max);
    }
  }
}
