#include <ctype.h>

int main()
{
    char c=0;
    int count=0;
    while((c=getchar())!='\n'){
        if(isupper(c)){
            count++;
        }
    }
    printf("%d",count);
    return 0;
}