Maggu has just joined play school. His teacher taught him A,a,B,b,C,c. He is much fascinated with these letters and now he is looking only for those strings which contains these letters only. But as i said he is a little guy he cant calculate the number of such sub-strings alone. So,he asked you (The String Calculator) for help.
Help little Maggu as i am not there to help him.
Refer test cases for better understanding
INPUT:
First line of input contains a single integer t denoting the number of test cases.Each test case consists of a single line containing string denoting maggu's search space.
OUTPUT:
Output consists of t lines each containing number of such substrings which contains only letters from the maggu's set of characters.
CONSTRAINTS:
t<=10
|strlen(str)| < =10^5