

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

/**
 *
 * @author sapagat
 */
public class JavaApplication40 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = Integer.parseInt(in.nextLine());
        String s= in.nextLine();
        int count_i = 0;
        int count_a = 0;
        int count_f = 0;
        for(int i = 0; i<n; i++){
            switch (s.charAt(i)) {
                case 'I':
                    count_i++;
                    break;
                case 'A':
                    count_a++;
                    break;
                default:
                    count_f++;
                    break;
            }
        }
        if(count_f==0 && count_i!=0){
            System.out.println(count_i);
        }
        else if(count_i==0 && count_a!=0){
            System.out.println(count_a);
        }
        else if(count_a==0 && count_i!=0){
            System.out.println(count_i);
        }
        else{
            if(count_a!=0 && count_i!=0){
                System.out.println(count_i);
            }
            else{
            System.out.println(0);
            }
        }
        
    }
    
}
