#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys

if __name__ == '__main__':
    n = int(sys.stdin.readline().strip())
    cows = sys.stdin.readline().strip()

    count = 0
    n_in  = 0
    for i in xrange(n):
        if cows[i] == 'I':
            n_in += 1

    for i in xrange(n):
        if cows[i] == 'F':
            continue
        if n_in == 0 or (n_in == 1 and cows[i] == 'I'):
            count += 1

    print count