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