import java.util.*;
import java.lang.Math;
public class Main
{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next();
		int a =0;
		int f=0;
		int j=0;
		for (int i=0;i<n ;i++ ){
		    if(s.charAt(i)=='A') a++;
		   else if(s.charAt(i)=='F') f++;
		    else j++;
		} 
		if(j==0) System.out.println(a);
		else System.out.println(j);
	}
}
