#include <bits/stdc++.h>
char a[200003];
int main() {
  int ans, i, n, in, f;
  while (scanf("%d", &n) != EOF) {
    scanf("%s", a);
    in = 0, f = 0;
    for (i = 0; i < n; i++) {
      if (a[i] == 'I') in++;
      if (a[i] == 'F') f++;
    }
    if (in == 0 && f == 0)
      ans = n;
    else if (f == 0)
      ans = in;
    else if (in == 0)
      ans = n - f;
    else
      ans = in;
    printf("%d\n", ans);
  }
  return 0;
}
