# Codeforces Round 174 Division 2
# Problem B

def showHands(n, status):
    countA = 0
    countF = 0
    countI = 0
    for i in xrange(n):
        if (status[i] == "A"):
            countA += 1
        elif (status[i] == "F"):
            countF += 1
        else:
            countI += 1
    if (countI == 0):
        return countA
    elif (countI == 1):
        return 1
    else:
        return 0

n = int(raw_input(""))
status = raw_input("")
print showHands(n, status)
