Count New Strings
题号:NC209485
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Besides data structures and number theory, ZYB also loves strings.

Consider a string  of length , denote S_i as the -th character in the string (1-based).
Define a string function  such that  and the -th character of  is .
For example, if , then .

Let . ZYB wants to know how many different strings in set  (i.e. the value of ).

输入描述:

The input only contains one test case. 
There is a string  in the first line, indicating the string we focus. 
It is guaranteed that the string is composed of only first  lowercase letters (i.e. ).

输出描述:

The output only contains one integer indicating the answer.
示例1

输入

复制
dbca

输出

复制
10
示例2

输入

复制
dbcad

输出

复制
15