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