Under construction

Still being built. Things may change

Department Survey

Time limit1sMemory limit1024 MB

Summary
Given each club member's grade, class, and number, count members per major and count first-year students who have no major.
Level

Easy1 of 10

Topics
Implementation
Solved
No attempts yet

Problem

Students at Daegu Software Meister High School choose a different major starting in their second year, based on their career path.

  • Software Development major: builds various software, such as front-end, back-end, and game development.
  • Embedded Software Development major: develops software for embedded devices using Raspberry Pi, Arduino, and similar boards.
  • Artificial Intelligence Software Development major: a new major opened last year, where students learn and develop AI.

To make students easier to manage, the school assigns Classes 1 and 2 to Software Development, Class 3 to Embedded Software Development, and Class 4 to Artificial Intelligence Software Development.

midori wants to find out how club members are distributed across majors.

Given the roster of club members, count how many belong to Software Development, Embedded Software Development, and Artificial Intelligence Software Development, and count how many first-year students cannot belong to any major.

Input

The first line contains the number of club members PP. (1≤P≤100)(1 \le P \le 100)

From the second line onward, the next PP lines each contain one student's grade GPG_P, class CPC_P, and number NPN_P, separated by spaces. (1≤GP≤3;1≤CP≤4;1≤NP≤20)(1 \le G_P \le 3; 1 \le C_P \le 4; 1 \le N_P \le 20) No two students share the same grade, class, and number.

All given numbers are integers.

Output

On the first line, print the number of students in the club who belong to Software Development.

On the second line, print the number of students in the club who belong to Embedded Software Development.

On the third line, print the number of students in the club who belong to Artificial Intelligence Software Development.

On the fourth line, print the number of first-year students in the club who do not belong to any major.

Examples1

  1. Example 1

    Input
    5
    1 3 5
    2 1 10
    2 2 12
    2 4 8
    3 3 10
    
    Expected output
    2
    1
    1
    1