import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class B {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		br.readLine();
		String s = br.readLine();
		int a, i, f;
		a = i = f = 0;
		for (int j = 0; j < s.length(); j++) {
			if (s.charAt(j) == 'A')
				a++;
			else if (s.charAt(j) == 'F')
				f++;
			else
				i++;
		}
		if (i == 0)
			out.println(a);
		else if (f == 0 && a == 0)
			out.println(s.length());
		else {
			int c = 0;
			for (int j = s.length() - 1; j > -1; j--) {
				if (s.charAt(j) == 'A')
					break;
				c++;
			}
			out.println(c);
		}
		br.close();
		out.close();
	}
}
