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
s=raw_input()
l=len(s)
arr=[]
i=0
j=0

while i<l:
	j=i+1
	while j<=l:
		arr.append(s[i:j])
		#print s[i:j]
		j=j+1
	i=i+1
	
print len(set(arr))