#include <bits/stdc++.h>
using namespace std;
int main() {
  string in;
  int players, total = 0;
  cin >> players;
  cin >> in;
  bool flag;
  for (int i = 0; i < players; i++) {
    flag = false;
    if (in.at(i) != 'F') {
      flag = true;
      for (int j = 0; j < players; j++) {
        if (in.at(j) != 'I') {
          flag = false;
        }
      }
    }
    if (!flag) {
      total++;
    }
  }
  cout << total;
  return 0;
}
