#!/usr/bin/env python

n = int(input())
str = raw_input()

can = 0
i = 0
for sym in str:
	if sym == "I":
		i += 1
	if sym != "F":
		can += 1

if i > 1:
	print(0)
elif i == 1:
	print(1)
else:
	print(can)
