n = int(input())
s = input()
dic = {}
for x in s:
	if x in dic:
		dic[x]+=1
	else:
		dic[x] = 1
if 'I' not in dic:
	dic['I']=0
if 'A' not in dic:
	dic['A'] = 0
	
if dic['I']==0:
	print(dic['A'])
else:
	print(dic['I'])
