import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
int[] arr = new int[4];
for (char c : line.toCharArray()) {
String s = String.valueOf(c);
if (s.matches("[a-zA-Z]")) {
arr[0] += 1;
} else if (s.equals(" ")) {
arr[1] += 1;
} else if (c >= '0' && c <= '9') {
arr[2] += 1;
} else {
arr[3] += 1;
}
}
for (int i : arr) {
System.out.println(i);
}
}
}