program xxxx;
var i,k,m,n,x,w:longint;
a,mm:array[1..200000] of longint;
begin
assign(input,'criminalc.in');
reset(input);
assign(output,'criminalc.out');
rewrite(output);
read(n,m,k);
w:=0;
for i:=1 to m do
read(mm[i]);
for i:=1 to n do
begin
read(a[i]);
if (a[i]=k)or(a[i]=-k) then
inc(w);
end;
for i:=1 to m do
begin
x:=mm[i];
if (a[k]=x)or(a[k]=-x) then
inc(w);
end;
write(w);
close(input);
close(output);
end.