eolymp
bolt
Try our new interface for solving problems
Problems

Substring

Substring

Given a string \textbf{s}. Count the number of different substrings. Empty substrings should not be counted. \InputFile One line \textbf{s}, consisting of lowercase Latin letters. The string length does not exceed \textbf{20 000} characters. \OutputFile Print the number of different substrings of \textbf{s}.
Time limit 2 seconds
Memory limit 64 MiB
Input example #1
aaaa
Output example #1
4