ABA
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The string of letters is given. How many times the subsequence "ABA" occurs in the given string? The letters "ABA" may not be adjacent, but their order must be preserved.
Input
One line containing only uppercase Latin letters. The length of the string does not exceed .
Output
Print the number of occurrences of the subsequence "ABA" in the string.
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 1K
Acceptance rate 28%