#include <bits/stdc++.h>
using namespace std;
const int N = 25;
int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int I = 0, A = 0, F = 0;
  for (int i = (0), _b = (n); i < (_b); ++i) {
    if (s[i] == 'I') ++I;
    if (s[i] == 'A') ++A;
    if (s[i] == 'F') ++F;
  }
  if (I) {
    cout << I << endl;
    return 0;
  }
  if (A) {
    cout << A << endl;
    return 0;
  }
  cout << 0 << endl;
  return 0;
}
