You are given a string S. Find the number of different substrings in S.

Input
One line containing a string S consisting of lowercase Latin letters.

Output
Output one integer - answer to the question.

Constraints
1 ≤ length of S ≤ 1200

SAMPLE INPUT
abc

SAMPLE OUTPUT
6
st = raw_input()
ans = set()
for i in range(len(st)):
    
    for j in range(i, len(st)):
        k = ""
        k = st[i:j+1]
        h = k
        ans.add(h)
print len(ans)