#include <bits/stdc++.h>
using namespace std;
bool check1(char x[]) {
  int i, len = strlen(x);
  for (i = 0; i < len; i++)
    if (x[i] != 'A' && x[i] != 'F') return 0;
  return 1;
}
bool check2(char x[]) {
  int i, len = strlen(x), c = 0;
  for (i = 0; i < len; i++)
    if (x[i] != 'A' && x[i] != 'F') return 1;
  return 0;
}
int count(char x[]) {
  int i, len = strlen(x), c = 0;
  for (i = 0; i < len; i++)
    if (x[i] != 'F') c++;
  return c;
}
char x[1000000];
int main() {
  int n, i;
  scanf("%d\n", &n);
  scanf("%s", x);
  if (check2(x))
    printf("%d\n", check2(x));
  else if (check1(x))
    printf("%d\n", count(x));
  else
    printf("0\n");
  return 0;
}
