import java.util.*;

public class Main{

    private void doit(){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int n = sc.nextInt();
            String s = sc.next();
            int count = 0;
            int countA = 0;
            for(int i = 0; i < n; i++){
                if(s.charAt(i) != 'F'){
                    if(s.charAt(i) == 'A'){
                        countA++;
                    }
                    count++;
                }
            }
            if(countA == 1){
                count--;
            }
            System.out.println(count);
        }
    }

    private void debug(Object... o) {
        System.out.println("debug = " + Arrays.deepToString(o));
    }

    public static void main(String[] args) {
        new Main().doit();
    }
}