Problem: 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

Solution (in PYTHON):

Solution:
def substr(string):
    j=1
    a=set()
    while True:
        for i in range(len(string)-j+1):
            a.add(string[i:i+j])
        if j==len(string):
            break
        j+=1
    return a
s=raw_input()
b=set()
b=substr(s)
print len(b)