import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner my =new Scanner(System.in);
        int a,i,acount=0,fcount=0;
        String ss;  
        a=my.nextInt();
        ss=my.next();
        for(i=0;i<a;i++){
            if(ss.charAt(i)=='F')
                fcount++;
            else if(ss.charAt(i)=='A')
                acount++;
        }
          if(acount == 1)
              System.out.print(a-fcount-1);
          else if(acount ==a)
              System.out.print(a);
          else if(fcount ==0 || fcount ==a)
              System.out.print(0);
          else
              System.out.print(a-fcount);     
    }
 
}
