Chef and proxy

can any one tell why my code is not accepted.have i missed something

/* package codechef; // don’t place package name! */

import java.util.;
import java.lang.
;
import java.io.*;

/* Name of the class has to be “Main” only if the class is public. */
class Codechef
{
public static void main (String[] args) throws java.lang.Exception
{
try {

	// your code goes here
	Scanner sc=new Scanner(System.in);
	int T=sc.nextInt();
	int a=0,c=0,count=0,count1=0;
	String S="";
	double b=0.0;
	for(a=0;a<T;a++)
	{
	   int D=sc.nextInt();
	  sc.nextLine();
	  
	   S=sc.nextLine();
	    b=D*0.75;//demand
	   
	   for(c=0;c<S.length();c++)
	   if(S.charAt(c)=='P')
	   count++;//present
	   
	   if(count>=b)
	   System.out.println("0");
	   
	   else
	   {
	   
	   for(c=0;c<D;c++)
	   if(c>1 && c<D-2)
	   {
	   if((S.charAt(c-1)=='P' ||S.charAt(c-2)=='P') && (S.charAt(c+1)=='P'||
	   S.charAt(c+2)=='P')&& s.charAt(c)=='A')
	   count1++;
	   }
	   
	   if(Math.ceil(b)-count<=count1)
	   System.out.println((int)(Math.ceil(b)-count));
	   
	   else
	   System.out.println("-1");
	   
	     count=0;
	     count1=0;
	     S="";
	   }
	    
	} 
	}
	
	catch(Exception e)
	{
	    return;
	    
	}
}

}