n = int(raw_input())

cows = raw_input()

ins = 0
allins = 0

for i in range(len(cows)):
    if cows[i] == 'I':
        ins += 1
    elif cows[i] == 'A':
        allins += 1

if ins > 1:
    print 0
elif ins == 1:
    print 1
else:
    print allins
    

