n = int(raw_input())
s = raw_input().strip()
st = {}
st['A'] = 0
st['I'] = 0
st['F'] = 0
slen = len(s)
for i in xrange(0, slen):
	st[s[i]] += 1
if (st['I'] == 0):
	print st['A']
elif (st['I'] == 1):
	print st['I']
else:
	print 0
