Distinct Substrings of a String

Given a string s, you are asked to find the number of distinct substrings of s. The substrings are considered distinct if they differ in at least one character.

Input

The only line of the input contains the string s (1 ≤ |s| ≤ 1000).

Output

The program should print the number of distinct substrings of s.

Examples

Input
Output
hello
14
habababohabo
62
 

Constraints

Time limit: 2 seconds

Memory limit: 512 MB

Output limit: 1 MB

To check your solution you need to sign in
Sign in to continue