import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
li = []
i = 0
lens = len(s)
while i < lens:
    for j in range(lens - i):
        t = s[i:i+j+1]
        if t not in li:
            li.append(t)
            i += j+1
            break
    else:
        i += 1
print(len(li))
















