#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[1000000];
  int N;
  scanf("%d", &N);
  scanf("%s", s);
  int i;
  int count = 0;
  for (i = N - 1; i >= 0; --i) {
    if (s[i] == 'F') {
      continue;
    }
    ++count;
    if (s[i] == 'I') {
      break;
    }
  }
  printf("%d\n", count);
  return 0;
}
