// Write your code here
let line = await readline();
let match_arr = line.match(/[A-Z]/g); // match 函数最方便
console.log(match_arr.length);