#B3817. Course Exam Failure Statistics

    ID: 11474 Type: Default 1000ms 256MiB

Course Exam Failure Statistics

Course Exam Failure Statistics

Little Pink Rabbit has taken N courses this semester. Each course is identified by its course code Ei. After the semester, exam scores are recorded for each course. However, due to adjustments, a course's score may be recorded more than once; in that case the later score overrides previous entries. A course is considered as passed if its final score is at least 60; otherwise, it is a failure.

If no score is recorded for any course, it means that Little Pink Rabbit did not attend the exam for that course, which is also counted as a failure.

Your task is to count how many courses have failed based on the available records.

The score values are treated in \(\LaTeX\) as follows: A course is passed if \(score \geq 60\) and failed if \(score < 60\) or missing altogether.

inputFormat

The first line contains two integers N and M separated by a space, representing the number of courses and the number of recorded score entries respectively.

The second line contains N strings representing the course codes Ei for the courses taken.

The following M lines each contain a course code and an integer score, separated by a space. If a course appears multiple times, the later record overwrites any earlier ones.

outputFormat

Output a single integer: the number of courses that are considered failed. A course fails if either the recorded score is less than 60 or no score is recorded.

sample

3 2
CS101 MATH102 PHY103
CS101 75
MATH102 50
2