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