#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int a = 0, ii = 0, f = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'A') {
      a++;
    } else if (s[i] == 'F') {
      f++;
    } else {
      ii++;
    }
  }
  cout << (n - f - ii);
  return 0;
}
