#include <bits/stdc++.h>
using namespace std;
int n, a[3 + 2];
string s;
int main() {
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'I')
      a[0]++;
    else if (s[i] == 'F')
      a[1]++;
    else
      a[2]++;
  }
  if (a[0] <= 2 && a[0] > 0)
    cout << a[0] << endl;
  else
    cout << a[2] << endl;
  return 0;
}
