#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  vector<map<string, int>> check(S.size() + 1);
  map<string, int> defaultMap;
  check[0] = defaultMap;
  for (int i = 0; i < S.size(); i++) {
    string searchString = string(1, S[i]);
    map<string, int> checkMap = check[i];
    if (checkMap.count(searchString) == 0) {
      checkMap[searchString] = 1;
      check[i + 1] = checkMap;
    } else {
      bool isDetermined = false;
      for (int j = 2; j <= i + 1; j++) {
        for (int k = i - j + 1; k >= 0; k--) {
          string target = S.substr(k, j);
          map<string, int> checkMap2 = check[k];
          if (checkMap2.count(target) == 0) {
            checkMap2[target] = 1;
            check[k + j] = checkMap2;
            isDetermined = true;
            i = k + j - 1;
            break;
          }
        }
        if (isDetermined) {
          break;
        }
      }
    }
  }
  cout << check[S.size()].size() << endl;
  return 0;
}
