#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string str;
  cin >> n >> str;
  int c = 0;
  for (int i = 0; i < n; i++) {
    if (str[i] == 'A') c++;
  }
  cout << c << endl;
}
