- Time limit: 1.00 s
- Memory limit: 512 MB
Your task is to calculate the number of distinct substrings in a string.
Input
The only input line contains a string of length n. Each character is between A–Z.
Output
Output the number of distinct substrings.
Constraints
- 1 \le n \le 10^5
Example
Input:
AYBABTU
Output:
26