import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException; 
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;



    public class Codeforces {
        
       

        public static void main(String[] args) throws IOException {
           BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
           int n = Integer.parseInt(br.readLine());
           int Folded = 0;
           int AllIn = 0;
           int In = 0;
           String s = br.readLine();
           for(char c : s.toCharArray()){
               if( c == 'A') AllIn++;
               else if(c == 'F') Folded++;
               else if(c == 'I') In++;
           }
           if(In == 0) System.out.println(AllIn);
           else if(In > 0) System.out.println(In);
        }    
    }




    

