import java.util.*;
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
String str=sc.nextLine();
//replaceAll支持正则表达式,replace不支持正则
String str1=str.replaceAll("[^A-Z]","");
System.out.println(str1.length());
}
}
public class Main{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
String str=sc.nextLine();
//replaceAll支持正则表达式,replace不支持正则
String str1=str.replaceAll("[^A-Z]","");
System.out.println(str1.length());
}
}