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()
s = set()
j = 1
while True:
    for i in xrange(len(st)-j+1):   
        s.add(st[i:i+j])
    if j==len(st):
    	break
    j+=1
print len(s)