import sys, math
def rs():
    return sys.stdin.readline().strip()
def ri():
    return int(sys.stdin.readline().strip())
def ras():
    return list(sys.stdin.readline().strip())
def rai():
    return map(int,sys.stdin.readline().strip().split())

n = ri()
s = rs()
if s.count("I") > 1:
    print 0
elif s.count("I") == 1:
    print 1
else:
    print s.count("A")