import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
while (scan.hasNext()) {
String input = scan.nextLine();
String str1 = input.replaceAll("[^a-zA-Z]","");
String str2 = input.replaceAll("[^ ]","");
String str3 = input.replaceAll("[^0-9]","");
String str4 = input.replaceAll("[a-zA-Z0-9 ]","");
System.out.println(str1.length());
System.out.println(str2.length());
System.out.println(str3.length());
System.out.println(str4.length());
}
}
}