#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum = 0, check = 0;
  int n;
  cin >> n;
  string x;
  cin >> x;
  reverse(x.begin(), x.end());
  for (int i = 0; i < n; i++)
    if (x[i] != 'I') check = 1;
  if (check == 0) {
    cout << 0;
    return 0;
  }
  for (int i = 0; i < x.size(); i++) {
    if (x[i] == 'I') {
      sum++;
      break;
    } else if (x[i] == 'F')
      continue;
    else
      sum++;
  }
  cout << sum;
}
