import java.util.Scanner;

public class Poker {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        String st = scanner.nextLine();
        int a = 0;
        int i = 0;
        int f = 0;
        for (char ch : st.toCharArray()) {
            if (ch == 'A') {
                a++;
            } else {
                if (ch == 'I') {
                    i++;
                } else {
                    f++;
                }
            }
        }

        if (a == 0  && i == 1 ){
            System.out.println(1);
        } else if( f == 0 &&  i ==1){
            System.out.println(a+1);
        } else {
            System.out.println(a);
        }

    }
}
