input
```
2
CCCCC
ABABA
```
output
```
5
9
```
by 单曦增 @ 2018-11-28 09:03:04
@[chen_zhe](/space/show?uid=8457)
by 单曦增 @ 2018-11-28 09:03:55
可以参考[spoj705](https://www.luogu.org/problemnew/show/SP705)(~~双倍经验题~~)的样例
by 单曦增 @ 2018-11-28 09:06:02
@lin_to_to
by 单曦增 @ 2018-11-28 09:36:27
@[lin_toto](/space/show?uid=256)
名字打错了。。。尴尬
by 单曦增 @ 2018-11-28 09:36:54
@[chen_zhe](/space/show?uid=8457)
by interestingLSY @ 2018-12-07 08:37:15
@[chen_zhe](/space/show?uid=8457)
by SkyRainWind @ 2018-12-31 22:58:32
@[chen_zhe](/space/show?uid=8457)
by fnoi15azhengbm @ 2019-02-14 17:13:25
@[yjjr](/space/show?uid=5088)
by AwwA @ 2019-03-27 11:43:03
@[xht37](/user/100544)
by __wfx @ 2019-12-19 21:12:56