AT_abc393_b [ABC393B] A..B..C
Description
A string $ S $ is given.
Find how many places in $ S $ have `A`, `B`, and `C` in this order at even intervals.
Specifically, find the number of triples of integers $ (i,j,k) $ that satisfy all of the following conditions. Here, $ |S| $ denotes the length of $ S $ , and $ S_x $ denotes the $ x $ -th character of $ S $ .
- $ 1 \leq i < j < k \leq |S| $
- $ j - i = k - j $
- $ S_i = $ `A`
- $ S_j = $ `B`
- $ S_k = $ `C`
Input Format
The input is given from Standard Input in the following format:
> $ S $
Output Format
Print the answer.
Explanation/Hint
### Sample Explanation 1
There are two triples $ (i,j,k) = (1,3,5) $ and $ (2,3,4) $ that satisfy the conditions.
### Constraints
- $ S $ is an uppercase English string with length between $ 3 $ and $ 100 $ , inclusive.