• + 1 comment

    import java.io.; import java.util.;

    public class Solution {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        String[] Name = new String[n];
        for (int i = 0; i < n; i++) {
            Name[i] = sc.next();
        }
        int S_count = 0;
        int R_count = 0;
        int H_count = 0;
        for (int i = 0; i < n; i++) {
            if (Name[i].equals("Student")) {
                S_count++;
            } else if (Name[i].equals("Rockstar")) {
                R_count++;
            } else if (Name[i].equals("Hacker")) {
                H_count++;
            }
        }
        System.out.println(S_count + " " + R_count + " " + H_count);
    }
    

    }