#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, k, l, res = 0, flg;
  scanf("%d", &n);
  char ch[n + 5], cur;
  j = 0;
  k = 0;
  l = 0;
  scanf("%s", ch);
  getchar();
  res = 0;
  for (i = 0; i < n; i++) {
    cur = ch[i];
    flg = 0;
    if (cur != 'F') {
      for (j = 1; j < n; j++) {
        if (ch[j] == 'I') {
          flg = 1;
          j = n;
        }
      }
      if (flg != 1) res++;
    }
  }
  printf("%d\n", res);
  return 0;
}
