s = input().rstrip() substr = set() for i in range(len(s)) : for j in range(len(s)-i) : substr.add(s[i:i+j+1]) print(len(substr))