import java.io.*;
import java.util.Scanner;
/**
 *
 * @author Iweerarathna
 */
public class CodeForces {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        try {
            new CodeForces().solve();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
    public void solve() throws Exception {
        Scanner scan = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        
        int n = scan.nextInt();
        scan.nextLine();
        String line = scan.nextLine();
        
        if (line.contains("I")) {
            out.write("1");
        } else {
            int p = 0;
            for (int i = 0; i < line.length(); i++) {
                if (line.charAt(i) == 'A') p++;
            }
            out.write(p);
        }
        
        out.close();
        scan.close();
    }
    
}
