from sys import stdin

import numpy as np

n,m,x= [int(x) for x in stdin.readline().rstrip().split()]

li = list(map(int,stdin.readline().rstrip().split()))



lin= [0]*(n+1)



for i in li:

    lin[i] = 1

print((min(sum(lin[:x]),sum(lin[x+1:]))))
n,m,x = list(map(int,input().split()))

a = list(map(int,input().split()))



li = [0]*(n+1)



for i in a:

    li[i] += 1



print((min(sum(li[:x+1]),sum(li[x:]))))
from sys import stdin
import numpy as np

n, m, x = [int(x) for x in stdin.readline().rstrip().split()]
li = list(map(int, stdin.readline().rstrip().split()))
lin = [0] * (n + 1)
for i in li:
    lin[i] = 1
print((min(sum(lin[:x]), sum(lin[x + 1 :]))))

n, m, x = list(map(int, input().split()))
a = list(map(int, input().split()))
li = [0] * (n + 1)
for i in a:
    li[i] += 1
print((min(sum(li[: x + 1]), sum(li[x:]))))

-from sys import stdin -import numpy as np - -n, m, x = [int(x) for x in stdin.readline().rstrip().split()] -li = list(map(int, stdin.readline().rstrip().split())) -lin = [0] * (n + 1) -for i in li: -    lin[i] = 1 -print((min(sum(lin[:x]), sum(lin[x + 1 :])))) +n, m, x = list(map(int, input().split())) +a = list(map(int, input().split())) +li = [0] * (n + 1) +for i in a: +    li[i] += 1 +print((min(sum(li[: x + 1]), sum(li[x:]))))