import java.util.Scanner;
public class exam3_1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入一段字符");
String s = sc.next();
int count1 = 0;
int count2 = 0;
int count3 = 0;
int count4 = 0;
char[] a = s.toCharArray();
for (int i = 0; i < s.length(); i++) {
char b = a[i];
if (b >= 65 && b<=90 || b >= 97 && b <= 122)
count1++;
else if(b == 32)
count2++;
else if (b >= 48 &&b <= 57) {
count3++;
}else {
count4++;
}
}
System.out.println("英文字母个数为" + count1);
System.out.println("空格个数为" + count2);
System.out.println("数字个数为" + count3);
System.out.println("其他字符个数为" + count4);
}
}