#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int a = 0, f = 0, i = 0;
  for (int x = 0; x < n; x++) {
    if (s[x] == 'A') a++;
    if (s[x] == 'F') f++;
    if (s[x] == 'I') i++;
  }
  int ans = i;
  if (i == n) ans = 0;
  if (i == 0) ans = a;
  cout << ans << '\n';
  return 0;
}
