#include<bits/stdc++.h>
using namespace std;
int main(){
    string str;
    while(getline(cin,str)){
        cout<<count_if(str.begin(), str.end(),[](char c){
            return isupper(c);
        });
        cout<<endl;
    }
}