const rl = require("readline").createInterface({ input: process.stdin });
var iter = rl[Symbol.asyncIterator]();
const readline = async () => (await iter.next()).value;
void async function () {
// Write your code here
while(line = await readline()){
let charCount =0;
let spaceCount =0;
let numCount =0;
let otherCount =0;
for(let i of line) {
if(/[A-Za-z]/.test(i)){
charCount++
} else if(/[0-9]/.test(i)){
numCount++
}else if(i === " ") {
spaceCount++
} else {
otherCount++
}
}
console.log(charCount + '\n'+ spaceCount + '\n' + numCount + '\n' + otherCount);
}
}()