# holes problem??

Chef wrote some text on a piece of paper and now he wants to know how many holes are in the text. What is a hole? If you think of the paper as the plane and a letter as a curve on the plane, then each letter divides the plane into regions. For example letters “A”, “D”, “O”, “P”, “R” divide the plane into two regions so we say these letters each have one hole. Similarly, letter “B” has two holes and letters such as “C”, “E”, “F”, “K” have no holes. We say that the number of holes in the text is equal to the total number of holes in the letters of the text. Help Chef to determine how many holes are in the text.
Input

The first line contains a single integer T <= 40, the number of test cases. T test cases follow. The only line of each test case contains a non-empty text composed only of uppercase letters of English alphabet. The length of the text is less then 100. There are no any spaces in the input.
Output

For each test case, output a single line containing the number of holes in the corresponding text.
Example

Input:
2
CODECHEF
DRINKEATCODE

Output:
2
5

this is the code i created but it didn’t run as it displays counter=0 irrespective of the if condition.

import java.util.Scanner;

public class holes {

``````public static void main(String[] args) {

Scanner scan = new Scanner(System.in);
int t;
String[][] array = new String;
int[] counter = new int;

System.out.println("Enter The Test Cases");
t = scan.nextInt();

for(int w =0; w<t;w++ ){
String input = scan.next();
array[w] = input.split("(?!^)");

for(int a=0;a<array[w].length;a++ ){

if(array[w][a] =="A"||array[w][a] =="P"||array[w][a] =="D"||array[w][a] =="O"||array[w][a] =="R"){
counter[w]++;
System.out.println(array[w][a]);
}
else if(array[w][a]=="B"){
counter[w]=counter[w]+2;
System.out.print(counter[w]+"\n");
}
}

}

for(int e=0;e<t;e++ ){
System.out.println(counter[e]);
}
scan.close();
}
``````

} Do you see a HOLE in this?

Remove that enter the test cases.Read the FAQ once before start solving problems.