#P8833. [传智杯 #3 决赛] 课程
[传智杯 #3 决赛] 课程
Description
Chuanzhi Professional Academy offers two courses , with students enrolled respectively. The IDs of students enrolled in are , and the IDs of students enrolled in are . Find how many students enrolled in both courses.
For all testdata, . It is guaranteed that the student IDs enrolled in each course will not repeat.
Input Format
The input has lines.
The first line contains two positive integers .
The second line contains positive integers , representing the student IDs enrolled in course .
The third line contains positive integers , representing the student IDs enrolled in course .
The student IDs are not guaranteed to be sorted in increasing order.
Output Format
Output one line containing one integer, which is the answer.
5 5
1 2 3 4 5
1 3 4 5 6
4
Hint
Sample Explanation
We find that these students with IDs enrolled in both courses, so the answer is .
Translated by ChatGPT 5
京公网安备 11011102002149号