import sys
import io

def work():
	l = int(sys.stdin.readline())
	arr = sys.stdin.readline()
	arr = arr.strip()
	numa = 0
	numi = 0
	for i in arr:
		if i == 'A':
			numa += 1
		if i == 'I':
			numi += 1
	if numi == 1:
		print 1
	elif numi ==0:
		print numa
	else :
		print 0

work()


