#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, k = 0;
  char* A;
  cin >> n;
  A = new char[n];
  for (i = 0; i < n; i++) cin >> A[i];
  for (i = 0; i < n; i++)
    if (A[i] == 'A') {
      k++;
    }
  cout << k;
  return 0;
}
