#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
long long int countDigit(long long int n) { return floor(log10(n) + 1); }
static const long long int dy[4] = {0, 1, 0, -1}, dx[4] = {1, 0, -1, 0};
template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  for (int i = 0; i < (int)v.size(); ++i) os << v[i] << " ";
  return os;
}
template <typename T1, typename T2>
ostream& operator<<(ostream& os, const map<T1, T2>& m) {
  for (auto p : m) os << "<" << p.first << ", " << p.second << "> ";
  return os;
}
int main() {
  string S;
  cin >> S;
  set<string> se;
  long long int start = 0;
  long long int len = 1;
  long long int N = S.length();
  while (start < N) {
    if (start + len >= N) break;
    string tmp = S.substr(start, len);
    if (se.find(tmp) == se.end()) {
      se.insert(tmp);
      len = 1;
      start += len;
    } else {
      len++;
    }
  }
  cout << se.size() << endl;
  return 0;
}
