z=int(raw_input())
a=raw_input()
count=0
for i in a:
    if i=='I':
        count+=1
if count==0:
    for i in a:
        if i=='A':
            count+=1
if count==0:
    for i in a:
        if i=='F':
            count+=1
print count