There are n cows playing poker at a table. For the current betting phase, each player's status is either "ALLIN", "IN", or "FOLDED", and does not change throughout the phase. To increase the suspense, a player whose current status is not "FOLDED" may show his/her hand to the table. However, so as not to affect any betting decisions, he/she may only do so if all other players have a status of either "ALLIN" or "FOLDED". The player's own status may be either "ALLIN" or "IN".

Find the number of cows that can currently show their hands without affecting any betting decisions.

Input

The first line contains a single integer, n (2 ≤ n ≤ 2·105). The second line contains n characters, each either "A", "I", or "F". The i-th character is "A" if the i-th player's status is "ALLIN", "I" if the i-th player's status is "IN", or "F" if the i-th player's status is "FOLDED".

Output

The first line should contain a single integer denoting the number of players that can currently show their hands.

Examples

Input

6
AFFAAA


Output

4


Input

3
AFI


Output

1

Note

In the first sample, cows 1, 4, 5, and 6 can show their hands. In the second sample, only cow 3 can show her hand.

import java.io.*;
import java.util.*;

public class B {

    public void solve() throws Exception {
        Scanner in = new Scanner(System.in);

        int n = in.nextInt();
        String s = in.next();
        int A = 0;
        int I = 0;
        for (int i = 0; i < n; i++) {
            if (s.charAt(i) == 'A') {
                A++;
            } else if (s.charAt(i) == 'I') {
                I++;
            }
        }

        if (I == 0) {
            System.out.println(A);
        } else if (I == 1) {
            System.out.println(I);
        } else {
            System.out.println(0);
        }
    }

    public static void main(String[] args) throws Exception {
        new B().solve();
    }

    class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner(InputStream input) {
            br = new BufferedReader(new InputStreamReader(input));
            st = null;
        }

        public Scanner(FileReader input) {
            br = new BufferedReader(input);
            st = null;
        }

        public String next() throws Exception {
            while (st == null || !st.hasMoreTokens()) {
                st = new StringTokenizer(br.readLine());
            }
            return st.nextToken();
        }

        public String nextLine() throws Exception {
            return br.readLine();
        }

        public int nextInt() throws Exception {
            return Integer.parseInt(next());
        }

        public long nextLong() throws Exception {
            return Long.parseLong(next());
        }

        public double nextDouble() throws Exception {
            return Double.parseDouble(next());
        }

        public boolean hasNextLine() throws Exception {
            if (br.ready()) {
                return true;
            }
            return false;
        }
    }
}
