import java.util.*;
import java.math.*;

public class Main {

	
    public void go() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String s = sc.next();
        
        int res = 0;
        for (int i = n-1; i >= 0; --i) {
        	if (s.charAt(i) != 'F') res++;
        	if (s.charAt(i) == 'I') break;
        }
        
        System.out.println(res);
        
    }

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