#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <optional>
#include <queue>
#include <sstream>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

int main() {
    string s;
    cin >> s;
    int32_t cnt = 0;
    for (auto i = 0; i < s.size(); ++i) {
        if (s[i] != 'A')
            continue;
        ++cnt;
    }
    cout << cnt << endl;
    return 0;
}