1.
var input = readline();
console.log(input.match(/[A-Z]/g)? input.match(/[A-Z]/g).length:0)
2.
var readline = require(“readline”);
const rl = readline.createInterface({
input:process.stdin,
output:process.stdout,
})
rl.on(‘line’,(line)=>{
console.log(line.match(/[A-Z]/g)? line.match(/[A-Z]/g).length:0)
})
3.
var line=””;
var all = ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ’;
while((line = readline())){
const arr = line.split(“”);
let n = 0;
arr.forEach((item)=>{
if(all.indexof(item)>-1){
n++;
}
});
console.log(n);
}
function upperCount(str){
let res = str.split(‘’);
let n = 0;
res.filter((item)=>{
if(item.charCodeAt()>=65 && item.charCodeAt<=90){
n++
}
return n;
})
}
while((str = readline())){
console.log(upperCount(str));
}
