#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int count1 = 0, count2 = 0, count3 = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'A') {
      count1++;
    } else if (s[i] == 'F') {
      count2++;
    } else {
      count3++;
    }
  }
  if (count3 == 1) {
    cout << count3 << '\n';
  } else {
    cout << count1 << '\n';
  }
}
