#B3857. Counting Ineligible Graduates Among Winners

    ID: 11514 Type: Default 1000ms 256MiB

Counting Ineligible Graduates Among Winners

Counting Ineligible Graduates Among Winners

At H School, the C exam is used to measure a student's ability in programming, data structures, and algorithms. The full score for the C exam is \(500\) points, and only those students who score at least \(200\) points are considered to have met the graduation requirements. Students scoring less than \(200\) points are considered ineligible for graduation.

In the R competition, the first prize winners are announced without much rigorous evaluation, and it has been observed that many ineligible students (those with scores below \(200\)) from H School win the first prize. You are given the C exam scores of \(N\) students of H School (indexed from \(1\) to \(N\)) and a list of first prize winners from the R competition. Note that the winner list may include IDs that are not in the range \([1, N]\) because other schools participate in the R competition.

Your task is to count how many winners from H School (i.e. those with IDs \(1\) to \(N\)) are ineligible for graduation.

inputFormat

The input consists of three lines:

  1. The first line contains two space-separated integers \(N\) and \(M\), where \(N\) is the number of students from H School and \(M\) is the total number of winners announced in the R competition.
  2. The second line contains \(N\) space-separated integers, where the \(i\)-th integer represents the C exam score of the \(i\)-th student. The full score of the exam is \(500\) points.
  3. The third line contains \(M\) space-separated integers, each representing a winner's ID in the R competition. Only IDs between \(1\) and \(N\) (inclusive) belong to H School.

outputFormat

Output a single integer representing the number of H School winners whose C exam score is less than \(200\) (i.e., those ineligible for graduation).

sample

5 4
200 199 250 150 300
1 2 6 4
2