1474: ABB形式

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:32 Solved:18

Description

ABB形式的字符串:是由3个字符组成,后两个字符相同,第一个字符与后面两个字符不同。
现在给定一个字符串(长度不超过100),请统计出字符串中有多少个ABB形式的子串,以及多少种ABB形式的子串。
例如:
s = "nnnseebbetoosee",ABB形式的子串有see、ebb、too、see,共4个。不同子串有see、ebb、too,共3种。

Input

输入一个长度不超过100的字符串$S$,只包含小写字母。

Output

输出两个整数,分别表示字符串$S$中有多少个ABB形式的子串,以及多少种ABB形式的子串。整数之间以一个空格隔开。

Sample Input Copy

nnnseebbetoosee

Sample Output Copy

4 3

Source/Category