import java.util.*; public class Main{ public static void main(String[] args) { Scanner scan = new Scanner(System.in); String s = scan.nextLine(); int Num = 0, num = 0, i; int n = s.length(); for(i = 0; i < n; i++) { if(s.charAt(i)>='A' && s.charAt(i)<='Z') Num++; else if(s.charAt(i)>='a' && s.charAt(i)<='z') num++; } System.out.println(Num); System.out.println(num); System.out.println(n-Num-num); scan.close(); } }