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

There are a total of $n$ 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 $k$ 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 $k$ Chosen Ones would be selected by the Technogoblet.


-----Input-----

The first line contains three integers $n$, $m$ and $k$ ($1 \le n \le 100$, $1 \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 $n$ different integers $p_1, p_2, \ldots, p_n$ ($1 \le p_i \le n$), where $p_i$ denotes the power of $i$-th student. The bigger the power, the stronger the student.

The third line contains $n$ integers $s_1, s_2, \ldots, s_n$ ($1 \le s_i \le m$), where $s_i$ denotes the school the $i$-th student goes to. At least one student studies in each of the schools. 

The fourth line contains $k$ different integers $c_1, c_2, \ldots, c_k$ ($1 \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 $k$ Chosen Ones would be selected by the Technogoblet.


-----Examples-----
Input
7 3 1
1 5 3 4 6 7 2
1 3 1 2 1 2 3
3

Output
1

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

Output
2



-----Note-----

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

In the second example, you can change the school of student $3$ to the made-up $5$ and the school of student $4$ to the made-up $6$. It will cause the Technogoblet to choose students $8$, $7$, $6$, $5$, $3$ and $4$.

Difficulty: EASY
Tags: Implementation

Starter code:

Solutions:
(n, m, k) = map(int, input().split())
sch = [0 for i in range(m)]
p = list(map(int, input().split()))
s = list(map(int, input().split()))
c = list(map(int, input().split()))
for i in range(n):
	sch[s[i] - 1] = max(sch[s[i] - 1], p[i])
res = 0
for i in c:
	i -= 1
	res += p[i] != sch[s[i] - 1]
print(res)


(n, m, k) = list(map(int, input().split()))
p = list(map(int, input().split()))
s = list(map(int, input().split()))
good = list(map(int, input().split()))
is_good = [0] * n
for el in good:
	is_good[el - 1] = 1
sch = [[] for i in range(m + 1)]
for i in range(n):
	sch[s[i]].append((p[i], i))
cnt = 0
for el in sch:
	el.sort(reverse=True)
	for i in el[1:]:
		cnt += is_good[i[1]]
print(cnt)


(n, m, k) = list(map(int, input().split()))
p = list(map(int, input().split()))
s = list(map(int, input().split()))
c = set(map(int, input().split()))
pup = list(zip(p, s, list(range(1, n + 1))))
pup.sort(reverse=True)
used = [False] * m
res = 0
for i in range(n):
	(v, sc, num) = pup[i]
	if used[sc - 1] and num in c:
		res += 1
	used[sc - 1] = True
print(res)


(n, m, k) = map(int, input().split())
d = {}
arr = [int(x) for x in input().split()]
sch = [int(x) for x in input().split()]
for i in range(len(arr)):
	d[sch[i]] = max(d.get(sch[i], 0), arr[i])
select = [int(x) for x in input().split()]
cnt = 0
for i in select:
	if d[sch[i - 1]] != arr[i - 1]:
		cnt += 1
print(cnt)


(n, m, k) = map(int, input().split())
p = list(map(int, input().split()))
s = list(map(int, input().split()))
c = list(map(int, input().split()))
d = [[] for i in range(m)]
for i in range(n):
	d[s[i] - 1].append((p[i], i + 1))
for i in range(m):
	d[i].sort(reverse=True)
ans = 0
for i in range(m):
	if d[i][0][1] in c:
		ans += 1
print(k - ans)


(n, m, k) = list(map(int, input().split()))
power = list(map(int, input().split()))
sch = list(map(int, input().split()))
chosen = list(map(int, input().split()))
ans = 0
d = dict()
for i in range(n + 1):
	d[i] = []
for i in range(n):
	d[sch[i]].append((power[i], i + 1))
for i in range(n + 1):
	d[i] = sorted(d[i])
for i in range(k):
	if d[sch[chosen[i] - 1]][-1][1] != chosen[i]:
		ans += 1
print(ans)


(n, m, k) = map(int, input().split())
s = list(map(int, input().split()))
p = list(map(int, input().split()))
c = list(map(int, input().split()))
maxs = [0 for i in range(m)]
for i in range(n):
	maxs[p[i] - 1] = max(maxs[p[i] - 1], s[i])
ans = 0
for x in c:
	if s[x - 1] != maxs[p[x - 1] - 1]:
		ans += 1
print(ans)


(n, m, k) = list(map(int, input().split()))
p = list(map(int, input().split()))
s = list(map(int, input().split()))
c = list(map(int, input().split()))
d = {}
for i in s:
	d[i] = 0
for i in range(len(s)):
	d[s[i]] = max(d[s[i]], p[i])
k = 0
for i in c:
	if d[s[i - 1]] > p[i - 1]:
		k += 1
print(k)


(n, m, k) = map(int, input().split())
sila = list(map(int, input().split()))
uch = list(map(lambda x: int(x) - 1, input().split()))
maxses = [0 for i in range(m)]
for i in range(n):
	maxses[uch[i]] = max(maxses[uch[i]], sila[i])
c = list(map(lambda x: int(x) - 1, input().split()))
ans = 0
for i in c:
	if sila[i] < maxses[uch[i]]:
		ans += 1
print(ans)


(n, m, k) = list(map(int, input().split()))
s = list(map(int, input().split()))
sh = list(map(int, input().split()))
izb = list(map(int, input().split()))
ssh = {}
for i in range(n):
	if sh[i] not in ssh:
		ssh[sh[i]] = s[i]
	else:
		ssh[sh[i]] = max(ssh[sh[i]], s[i])
u = 0
result = 0
izb = sorted(izb)
for i in range(n):
	if u == len(izb):
		break
	if i + 1 == izb[u]:
		if ssh[sh[i]] > s[i]:
			result += 1
		u += 1
print(result)


(n, m, k) = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
res = 0
for i in list(map(int, input().split())):
	m = 0
	for j in range(n):
		if b[i - 1] == b[j]:
			m = max(m, a[j])
	if m != a[i - 1]:
		res += 1
print(res)


(n, m, k) = map(int, input().split())
students = list(map(int, input().split()))
schools = list(map(int, input().split()))
v = list(map(int, input().split()))
school_stud = [[] for i in range(max(schools) + 1)]
for i in range(len(schools)):
	school_stud[schools[i]].append((students[i], i))
for i in range(len(school_stud)):
	school_stud[i].sort()
count = 0
for i in range(len(v)):
	if school_stud[schools[v[i] - 1]][-1][1] != v[i] - 1:
		count += 1
print(count)


(n, m, k) = list(map(int, input().split()))
p = list(map(int, input().split()))
s = list(map(int, input().split()))
c = list(map(int, input().split()))
dct = {}
for i in range(n):
	if s[i] in dct:
		dct[s[i]] = max(dct[s[i]], p[i])
	else:
		dct[s[i]] = p[i]
data_to_fuck_you = 0
for i in range(k):
	power = p[c[i] - 1]
	school = s[c[i] - 1]
	if power < dct[school]:
		data_to_fuck_you += 1
print(data_to_fuck_you)


(n, m, k) = map(int, input().split())
peps = list(map(int, input().split()))
schs = list(map(int, input().split()))
want = list(map(int, input().split()))
ls = [[] for i in range(m)]
for i in range(n):
	ls[schs[i] - 1].append([peps[i], i])
ans = k
for sch in ls:
	if max(sch)[1] + 1 in want:
		ans -= 1
print(ans)


(n, m, k) = [int(i) for i in input().split()]
a = [[0, 0] for i in range(m + 1)]
p = [int(i) for i in input().split()]
s = [int(i) for i in input().split()]
f = [int(i) for i in input().split()]
for i in range(n):
	num = i + 1
	sk = s[i]
	po = p[i]
	if po > a[sk][1]:
		a[sk][0] = num
		a[sk][1] = po
l = set()
for i in range(1, m + 1):
	l.add(a[i][0])
f = set(f)
f -= l
print(len(f))


(n, m, k) = map(int, input().split())
best = [(0, 0) for i in range(m)]
w = list(map(int, input().split()))
s = list(map(int, input().split()))
st = set(list(map(int, input().split())))
for i in range(n):
	best[s[i] - 1] = max((w[i], i + 1), best[s[i] - 1])
for e in best:
	k -= e[1] in st
print(k)


(n, m, k) = map(int, input().split())
p = list(map(int, input().split()))
s = list(map(int, input().split()))
c = list(map(int, input().split()))
lst = []
ans = 0
for i in range(m):
	lst.append([])
for i in range(n):
	lst[s[i] - 1].append((p[i], i))
for i in range(m):
	lst[i].sort()
	lst[i] = lst[i][-1::-1]
	cnt = 0
	for j in range(1, len(lst[i])):
		if lst[i][j][1] + 1 in c:
			ans += 1
print(ans)


(n, m, k) = list(map(int, input().split()))
ps = list(map(int, input().split()))
schs = [list() for _ in range(m)]
ss = list(map(int, input().split()))
for i in range(n):
	schs[ss[i] - 1].append((ps[i], i))
for j in range(m):
	schs[j].sort()
n = 0
cs = list(map(int, input().split()))
for c in cs:
	c -= 1
	if schs[ss[c] - 1][-1][1] != c:
		n += 1
print(n)


kol = 0
(n, m, k) = map(int, input().split())
p = list(map(int, input().split()))
s = list(map(int, input().split()))
for i in range(n):
	s[i] -= 1
c = list(map(int, input().split()))
for i in range(k):
	c[i] -= 1
sc = [[] for i in range(m)]
for i in range(n):
	sc[s[i]].append([p[i], i])
for i in range(m):
	sc[i] = sorted(sc[i])
for i in range(k):
	if sc[s[c[i]]][-1][0] != p[c[i]]:
		kol += 1
print(kol)


(n, m, k) = list(map(int, input().split()))
p = list(map(int, input().split()))
s = list(map(int, input().split()))
c = list(map(int, input().split()))
sc = [-1 for i in range(m)]
for i in range(n):
	if sc[s[i] - 1] == -1 or p[sc[s[i] - 1]] <= p[i]:
		sc[s[i] - 1] = i
ans = 0
for i in range(k):
	ans += 0 if c[i] - 1 in sc else 1
print(ans)


(n, m, k) = list(map(int, input().split()))
p = list(map(int, input().split()))
s = list([int(x) - 1 for x in input().split()])
c = list([int(x) - 1 for x in input().split()])
cc = [None] * m
for x in range(0, m):
	who = [y for y in range(0, n) if s[y] == x]
	who.sort(key=lambda y: p[y])
	who.reverse()
	cool = False
	if len(who) >= 2 and p[who[0]] == p[who[1]]:
		cool = True
	if len(who) == 0:
		who = [-1]
	cc[x] = (cool, who[0])
a = 0
for x in c:
	if len([y for y in cc if not y[0] and y[1] == x]) == 0:
		a += 1
print(a)


(n, m, k) = map(int, input().split())
p = list(map(int, input().split()))
s = list(map(int, input().split()))
c = list(map(int, input().split()))
se = list(set(s))
slov = dict()
for i in range(len(se)):
	slov[se[i]] = []
for i in range(len(s)):
	slov[s[i]].append([p[i], i + 1])
for i in se:
	slov[i].sort(reverse=True)
ans = [True] * (n + 1)
for i in se:
	ans[slov[i][0][1]] = False
ans1 = 0
for i in c:
	if ans[i]:
		ans1 += 1
print(ans1)


(n, m, k) = map(int, input().split())
strong = list(map(int, input().split()))
sch = list(map(int, input().split()))
best = list(map(int, input().split()))
arr = [[] for i in range(m + 1)]
for i in range(n):
	arr[sch[i]].append((i, strong[i]))
S = set()
for el in best:
	S.add(el)
M = set()
for i in range(len(arr)):
	max_ = -100000
	pup = -1
	for j in range(len(arr[i])):
		if arr[i][j][1] > max_:
			max_ = arr[i][j][1]
			pup = arr[i][j][0]
	M.add(pup + 1)
for el in M:
	if el in S:
		S.remove(el)
print(len(S))


(n, m, k) = list(map(int, input().split()))
p = list(map(int, input().split()))
s = list(map(int, input().split()))
c = list(map(int, input().split()))
sc = [0] * m
pt = [0] * m
add = 0
for i in range(m):
	ts = i + 1
	while ts in s:
		x = s.index(ts)
		if p[x] > sc[i]:
			sc[i] = p[x]
			pt[i] = x + 1
		s[x] = m + 1
for t in c:
	if t not in pt:
		add += 1
print(add)