Substring#754

Substring

2 seconds
64 megabytes
Hard (≈1650)

Given a string s. Count the number of different substrings. Empty substrings should not be counted.

Input

One line s, consisting of lowercase Latin letters. The string length does not exceed 20 000 characters.

Output

Print the number of different substrings of s.

Examples

Example 1

Loading
Loading