# -*- coding: utf-8 -*-
import sys

if __name__ == '__main__':

    num1 = map(int,sys.stdin.readline().split())
    str1 = map(str,sys.stdin.readline().split())
    if  str1[0].count('I') != 0 :
        print str1[0].count('I')
    else:
        print str1[0].count('A')
