def main():
	d = {'A': 0, 'I': 0, 'F': 0}
	n = input()
	str1 = raw_input()
	for i in str1:
		d[i]+=1
	if (d['I']==0):
		print d['A']
		return
	if (d['I']==1):
		print 1
		return
	if (d['I']>1):
		print 0
		return


main()