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
'''
import itertools
print len(list(set([''.join(alpha) for alpha in itertools.permutations(raw_input())])))

def get subs(string):
'''
S = raw_input()
print len(list(set([S[x:y] for x in range(len(S)+1) for y in range(len(S)+1) if S[x:y]])))