import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Poker {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    Map<Character, Integer> map = new HashMap<>();
    in.nextLine();
    String s = in.nextLine();
    map.put('A', 0);
    map.put('I', 0);
    map.put('F', 0);

    for (int i = 0; i < s.length(); i++) {
      char c = s.charAt(i);
      map.put(c, map.get(c) + 1);
    }
    System.out.println(map.get('I') != 0 ? map.get('I') : map.get('A'));
  }
}
