#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d;
  char xx[2 * 100005];
  int suma, sumi, sumf;
  while (~scanf("%d", &a)) {
    suma = sumi = sumf = 0;
    scanf("%s", xx);
    for (int i = 0; i < a; i++) {
      if (xx[i] == 'A')
        suma++;
      else if (xx[i] == 'F')
        sumf++;
      else if (xx[i] == 'I')
        sumi++;
    }
    if (suma && sumf && sumi) {
      printf("%d\n", a - suma - sumf);
    } else {
      if (!sumi)
        printf("%d\n", a - sumf);
      else
        printf("%d\n", a - sumi - sumf);
    }
  }
  return 0;
}
