n = input()
arr = raw_input()
a, i, f = 0, 0, 0
for w in arr:
    if w == 'A':
        a += 1
    elif w == 'F':
        f += 1
    elif w == 'I':
        i += 1

if i > 0:
    print 0
elif i == 1:
    print 1
else:
    print a

    
