import java.util.*; public class Main { public static void main(String args[]) { Scanner input = new Scanner(System.in); while(input.hasNext()){ String s = input.nextLine(); System.out.println(count(s)); } } public static int count(String s){ int count=0; char[] cs=s.toCharArray(); for(char c:cs){ if(c>='A' && c<='Z'){ count++; } } return count; } }