#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, z, ot = 0, x, in = 0, f = 0;
  char s;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> s;
    if (s == 'I') in++;
    if (s == 'F') f++;
  }
  if (in > 1)
    cout << "0" << endl;
  else if (in == 1)
    cout << "1" << endl;
  else
    cout << n - f << endl;
  return 0;
}
