#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, flag = 0, counti = 0, counta = 0;
  long long int n;
  string s;
  cin >> n;
  cin >> s;
  for (i = 0; i < n; i++) {
    if (s[i] == 'I') {
      flag = 1;
      counti++;
    }
  }
  if (flag == 0) {
    for (i = 0; i < n; i++) {
      if (s[i] == 'A') {
        counta++;
      }
    }
  }
  if (flag == 0) {
    cout << counta << endl;
  } else {
    cout << counti << endl;
  }
  return 0;
}
