n=int(input())
s=input()
koli=0
kola=0
for i in range(n):
    if s[i]=='I':
        koli+=1
    if s[i]=='A':
        kola+=1
if koli>1:
    print(0)
    exit()
if koli==1:
    print(1)
    exit()
print(kola)