#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
int n, son[maxn][26], tot, now;
char S[maxn];
int calc() {
  tot = now = 0;
  memset(son, 0, sizeof(son));
  for (int i = 1; i <= n; i++) {
    int index = S[i] - 'a';
    if (son[now][index] == 0) {
      son[now][index] = ++tot;
      now = 0;
    } else
      now = son[now][index];
  }
  return tot;
}
int main() {
  scanf("%s", S + 1);
  n = strlen(S + 1);
  int ans = calc();
  reverse(S + 1, S + 1 + n);
  ans = max(ans, calc());
  printf("%d\n", ans);
}
