#include <bits\stdc++.h>
#define FIX 1000000007
using namespace std;

int main()
{
    int n , I  = 0, A = 0; cin >> n;
    string ch;
    cin >> ch;
    for(int i = 0; i < n; i ++)
    {
        if(ch[i] == 'A')
            A++;
        else if(ch[i] == 'I')
            I++;
    }
    int ans = 0;
    if(I == 0)
        ans += A;
    ans += I;
    cout << ans << endl;
}
