def solve(a, f, i):
    A = 0
    if i==0: A = a
    I = 0
    if i==1: I = i
    return A+I

n = raw_input()

w = raw_input()
a, f, i= 0, 0, 0
for ch in w:
    if ch == 'A': a+=1
    elif ch == 'F': f+=1
    elif ch == 'I': i+=1
print(solve(a, f, i))
