#include<iostream>
#include <cstring>
using namespace std;
char a[100];
int c=0;
int main(){
    gets(a);
    for(int i=0;i<strlen(a);i++){
        if(a[i]>='A'&&a[i]<='Z'){
            c++;
        }
    }
    cout<<c;
    return 0;
}
/**************************************************************
	Problem: 1007
	User: lidongbo
	Language: C++
	Result: Accepted
	Time:7 ms
	Memory:2072 kb
****************************************************************/