string
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

We call  non-equivalent if and only if  and , where  refers to the string obtained by reversing characters of , for example .
There is a string  consisted of lower-case letters. You need to find some substrings of  so that any two of them are non-equivalent. Find out what's the largest number of substrings you can choose.

输入描述:

A line containing a string  of lower-case letters.

输出描述:

A positive integer - the largest possible number of substrings of  that are non-equivalent.
示例1

输入

复制
abac

输出

复制
8

说明

The set of following substrings is such a choice: .

备注:

 is consisted of lower-case letters.