import sys

inp = sys.stdin
if 0:
    from StringIO import StringIO
    s1 = '''3
AFI'''

    inp = StringIO(s1)


def read_ints():
    return map(int, inp.readline().split(' '))


n, = read_ints()
s = inp.readline().strip()
cnt = {'A':0, 'I':0, 'F':0}

for c in s:
    cnt[c] += 1

res = 0
if cnt['A'] > 0:
    if cnt['I'] == 0:
        res += cnt['A']

if cnt['I'] > 0:
    if cnt['I'] == 1:
        res += cnt['I']

print res


