while(line = readline()) {
let reg = new RegExp('[A-Z]', 'g')
const result = line.match(reg) ? line.match(reg).length : 0;
console.log(result);
}
while(line = readline()) {
let reg = new RegExp('[A-Z]', 'g')
const result = line.match(reg) ? line.match(reg).length : 0;
console.log(result);
}