#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  char c[200001];
  cin >> n >> c;
  int a = 0, f = 0, i = 0;
  for (int i = 0; i < n; i++) {
    if (c[i] == 'A') {
      a++;
    } else {
      if (c[i] == 'F') {
        f++;
      } else {
        i++;
      }
    }
  }
  if (i == 1) {
    cout << 1;
  }
  if (i == 0) {
    cout << a;
  }
}
