#include <bits/stdc++.h>
int main() {
  int arr[3] = {0};
  int i, n;
  char str[300000];
  scanf("%d", &n);
  scanf("%s", str);
  for (i = 0; i < n; i++) {
    if (str[i] == 'A')
      arr[0]++;
    else if (str[i] == 'F')
      arr[1]++;
    else
      arr[2]++;
  }
  if (arr[2] == n)
    printf("%d", arr[0]);
  else if (arr[2] == 0)
    printf("%d", arr[0]);
  else
    printf("%d", arr[2]);
  return 0;
}
