CF1121A.Technogoblet of Fire

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

Technogoblet of Fire

Everybody knows that the mm-coder Tournament will happen soon. mm schools participate in the tournament, and only one student from each school participates.

There are a total of nn students in those schools. Before the tournament, all students put their names and the names of their schools into the Technogoblet of Fire. After that, Technogoblet selects the strongest student from each school to participate.

Arkady is a hacker who wants to have kk Chosen Ones selected by the Technogoblet. Unfortunately, not all of them are the strongest in their schools, but Arkady can make up some new school names and replace some names from Technogoblet with those. You can't use each made-up name more than once. In that case, Technogoblet would select the strongest student in those made-up schools too.

You know the power of each student and schools they study in. Calculate the minimal number of schools Arkady has to make up so that kk Chosen Ones would be selected by the Technogoblet.

Input

The first line contains three integers nn, mm and kk (1n1001 \le n \le 100, 1m,kn1 \le m, k \le n) — the total number of students, the number of schools and the number of the Chosen Ones.

The second line contains nn different integers p1,p2,,pnp_1, p_2, \ldots, p_n (1pin1 \le p_i \le n), where pip_i denotes the power of ii-th student. The bigger the power, the stronger the student.

The third line contains nn integers s1,s2,,sns_1, s_2, \ldots, s_n (1sim1 \le s_i \le m), where sis_i denotes the school the ii-th student goes to. At least one student studies in each of the schools.

The fourth line contains kk different integers c1,c2,,ckc_1, c_2, \ldots, c_k (1cin1 \le c_i \le n)  — the id's of the Chosen Ones.

Output

Output a single integer  — the minimal number of schools to be made up by Arkady so that kk Chosen Ones would be selected by the Technogoblet.

Note

In the first example there's just a single Chosen One with id 33. His power is equal to 33, but in the same school 11, there's a student with id 55 and power 66, and that means inaction would not lead to the latter being chosen. If we, however, make up a new school (let its id be 44) for the Chosen One, Technogoblet would select students with ids 22 (strongest in 33), 55 (strongest in 11), 66 (strongest in 22) and 33 (strongest in 44).

In the second example, you can change the school of student 33 to the made-up 55 and the school of student 44 to the made-up 66. It will cause the Technogoblet to choose students 88, 77, 66, 55, 33 and 44.

Samples

7 3 1
1 5 3 4 6 7 2
1 3 1 2 1 2 3
3
1
8 4 4
1 2 3 4 5 6 7 8
4 3 2 1 4 3 2 1
3 4 5 6
2

在线编程 IDE

建议全屏模式获得最佳体验