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:
s = raw_input()
k = set()
for i in range(0,len(s)+1):
	for j in range(0,len(s)+1):
		if i != j:
			k.add(s[i:j:])
			
#print  k
		
print len(k)-1