n = input()
cs = raw_input()

a = cs.count('A')
f = cs.count('F')
i = cs.count('I')

if a > 0 and f > 0 and i == 0:
    print a
elif a > 0 and f > 0 and i > 0:
    print i
elif a > 0 and f == 0 and i == 0:
    print 0
elif a > 0 and f == 0 and i > 0:
    print i
elif a == 0 and f > 0 and i == 0:
    print 0
elif a == 0 and f > 0 and i > 0:
    print i
elif a == 0 and f == 0 and i == 0:
    print 0
elif a == 0 and f == 0 and i > 0:
    print 0 
