#include <iostream>
#include <cctype>
#include <string>
using namespace std;
int main() {
string s;
int count = 0;
getline(cin, s);
for (char c : s) {
if (isupper(c)) {
count++;
}
}
cout << count << endl;
return 0;
}
/**************************************************************
Problem: 1007
User: fuhoubin
Language: C++
Result: Accepted
Time:16 ms
Memory:2076 kb
****************************************************************/