Problem10091--ABC347 —— B - Substring

10091: ABC347 —— B - Substring

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 512 MiB

Description

You are given a string $S$ consisting of lowercase English letters. How many different non-empty substrings does $S$ have?

A substring is a contiguous subsequence. For example, `xxx` is a substring of `yxxxy` but not of `xxyxx`.

Input

The input is given from Standard Input in the following format:

```
$S$
```

Output

Print the answer.

Constraints

-   $S$ is a string of length between $1$ and $100$, inclusive, consisting of lowercase English letters.

Sample 1 Input

yay

Sample 1 Output

5

S has the following five different non-empty substrings:

  • a
  • y
  • ay
  • ya
  • yay

Sample 2 Input

aababc

Sample 2 Output

17

Sample 3 Input

abracadabra

Sample 3 Output

54

Source/Category