机考考这个多爽

import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            
            String str = scan.nextLine();
            int count = 0;
            for(char c : str.toCharArray()){
                if(String.valueOf(c).matches("[A-Z]")){
                    count++;
                }
            }
            System.out.println(count);
        }
        scan.close();
    }
}