from sys import stdin,stdout
ii1 = lambda: int(stdin.readline().strip())
is1 = lambda: stdin.readline().strip()
iia = lambda: list(map(int, stdin.readline().strip().split()))
isa = lambda: stdin.readline().strip().split()
mod = 1000000007

n = ii1()
arr = is1()
if 'I' in arr:
    if arr.count('I') > 1:
        print(0)
    else:
        print(1)
else:
    print(arr.count('A'))