n = int(raw_input())
s = raw_input()
A = 0
F = 0
I = 0
n = int(len(s))
for i in range(0,n):
    A += s[i]=='A'
    F += s[i]=='F'
    I += s[i]=='I'
ans = 0
if I>1:
    ans = 0
elif I==1:
    ans = 1
else:
    ans = A
print ans
#print(ans)

