t = input()
string = raw_input()
if 'I' in string:
    count = string.count('I')
    if count>1:
        print 0
    else:
        print 1
elif 'A' in string:
    print string.count('A')
else:
    print 0
