def token(f):
	whitespace, l = ' \t\n', []
	while True:
		c = f.read(1)
		if not c:
			if len(l) and l[-1] not in whitespace: break
			else: raise EOFError
		elif c in whitespace and len(l) and l[-1] not in whitespace:
			break
		l.append(c)
	return ''.join(l)

def whole_line(f):
	l = []
	while True:
		c = f.read(1)
		if not c:
			if len(l): return ''.join(l)
			raise EOFError
		elif c=='\n':
			return ''.join(l)
		l.append(c)

def readint(f):	return int(token(f))
def readfloat(f): return float(token(f))
def readstr(f): return token(f).split()[0]
def readline(f):
	line = whole_line(f)
	return line if line.split() else readline(f)

from sys import stdin as si

readint(si)
s = readline(si)

cnt = 0
if 'I' in s:
	for c in s:
		if c == 'I':
			cnt += 1
	print 1 if cnt == 1 else 0			
else:
	for c in s:
		if c != 'F':
			cnt +=1
	print cnt
