#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, flen = 0, alen = 0, ilen = 0;
  char a[200009];
  cin >> n;
  for (i = 1; i < n + 1; i++) {
    cin >> a[i];
    if (a[i] == 'F') flen++;
    if (a[i] == 'A') alen++;
    if (a[i] == 'I') ilen++;
  }
  if (ilen == 1)
    cout << ilen << endl;
  else if (ilen == 0)
    cout << alen << endl;
  return 0;
}
