import java.util.Arrays;
import java.util.Scanner;

public class TaskB {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int p = Integer.parseInt(scanner.nextLine());
		char[] line = scanner.nextLine().toCharArray();

		int countF = 0, countA = 0, countI = 0;
		for (int i = 0; i < line.length; i++) {
			if (line[i] == 'F') {
				countF++;
			} else if (line[i] == 'A') {
				countA++;
			} else {
				countI++;
			}
		}
		int result = 0;
		if (p - countI != 0 && countF != p) {
			if (countI == 0) {
				result = countA;
			} else {
				result = countI;
			}
		}

		System.out.println(result);
	}
}
