//package round37;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        int res = 0;
        for(int i=0; i<n; ++i) {
            if(s.charAt(i) == 'F') continue;
            if(s.indexOf('I')==-1 || s.indexOf('I') == i) {
                res++;
            }
        }
        System.out.println(res);
    }
}
