raw_input()
cows=raw_input()
IN=0
ALLIN=0
FOLDED=0
result=0
for i in cows:
    if i=='I':
        IN+=1
    elif i=='A':
        ALLIN+=1
    else:
        FOLDED+=1
if FOLDED>=0 and IN==0:
    result+=ALLIN
elif FOLDED>0 and IN>0:
    result+=IN
print result