Substrings#2356

Substrings

2 seconds
64 megabytes
Medium

Given a string . Count the number of different substrings of . The empty substring should not be counted.

Input

The input contains one string , consisting of lowercase Latin letters. The length of does not exceed characters.

Output

Print the number of different substrings of .

Examples

Example 1

Loading
Loading