#include<stdio.h>

int main(){

char data[1000]={0};
while(fgets(data, 1000, stdin)){
    int lenth;
    for (lenth = 0; data[lenth] != '\n'; lenth++);
    int eng = 0;
    int block = 0;
    int num = 0;
    int other = 0;
    for(int i=0; i<lenth; i++){
        if((data[i]>='a' && data[i]<='z') || (data[i]>='A' && data[i]<='Z')){
            eng++;
        }
        else if(data[i] == ' '){
            block++;
        }
        else if(data[i] >= '0' && data[i]<='9'){
            num++;
        }
        else{
            other++;
        }
    }
    printf("%d\n%d\n%d\n%d\n", eng, block, num, other);
    }

}