#include <iostream>
#include <string.h>
using namespace std;
int main(){
char s[105];
cin >> s;
int len = strlen(s);
int cnt = 0;
for (int i = 0; i < len; i++) {
if (s[i] == 'A') {
cnt++;
}
}
cout << cnt << endl;
return 0;
}
#include <iostream>
#include <string.h>
using namespace std;
int main(){
char s[105];
cin >> s;
int len = strlen(s);
int cnt = 0;
for (int i = 0; i < len; i++) {
if (s[i] == 'A') {
cnt++;
}
}
cout << cnt << endl;
return 0;
}