import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;


public class Poker {
	
	public static void main(String[] args) {
		
		long n;
//		List<String> statusI=new ArrayList<>();
//		List<String> statusA=new ArrayList<>();
//		List<String> statusF=new ArrayList<>();
		int countI=0;
		int countA=0;
		int countF=0;
		String line;
		
		Scanner sc=new Scanner(System.in);
		n=sc.nextLong();
		line=sc.next();
		for (int i=0; i<line.length(); i++) {
			if (line.charAt(i)=='A')
				countA++;
			else {
				if (line.charAt(i)=='I')
					countI++;
				else {
					countF++;
				}
			}
		}
		
		int result=0;
		if (countI>1)
			result=0;
		else {
			if (countI==1)
				result=1;
			else {
				result=countA;
			}
		}
		System.out.println(countA);		
		
	}
	

}
