String Value
题号:NC237349
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

Define the value of a string as the number of occurrences of the character with the most occurrences minus the number of occurrences of the character with the least occurrences in the string.

Now give you a string , ask what is the maximum value of all nonempty substrings of (a substring is a contiguous sequence of characters within a string).

输入描述:

A line contains a string  containing only lowercase letters. ().

输出描述:

Output an integer on a line, indicating the answer.
示例1

输入

复制
aabbaaabab

输出

复制
3