#include <bits/stdc++.h>
using namespace std;
char m[410000];
int main() {
  int n;
  cin >> n;
  int i = 0, a = 0, f = 0;
  cin >> m;
  for (int j = 0; j < n; j++) {
    if (m[j] == 'I') {
      i++;
    }
    if (m[j] == 'A') {
      a++;
    }
    if (m[j] == 'F') {
      f++;
    }
  }
  if (a != 0 && i == 0) {
    cout << a;
  }
  if (a != 0 && i == 1) {
    cout << i;
  }
  if (a != 0 && i != 1 && i != 0) {
    cout << 0;
  }
  if (a == 0 && i == 0) {
    cout << 0;
  }
  return 0;
}
