import java.util.Scanner;

public class CowsAndBokerGame {

	public static void main(String[] args) {
		Scanner input = new Scanner(System.in) ;
		int n = input.nextInt();
		String s = input.next().trim();
		input.close();
		int cnt_I  = 0;
		int cnt_F  = 0;
		for(int i = 0 ; i < n ; i++){
			if(s.charAt(i) == 'I'){
				cnt_I ++ ;
			}else if(s.charAt(i) == 'F'){
				cnt_F ++ ;
			}
		}
		if(cnt_I == 1){
			System.out.println(cnt_I);
		}else {
			System.out.println(n - cnt_F);
		}
	}

}
