n,m,x=list(map(int,input().split()))

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

b=[0+(i in a)for i in range(n+1)]

print((min(sum(b[:x]),sum(b[x:]))))
from bisect import bisect_left

n,m,x=list(map(int,input().split()))

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

b=bisect_left(a,x)

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

from bisect import bisect_left

n, m, x = list(map(int, input().split()))
a = list(map(int, input().split()))
b = bisect_left(a, x)
print((min(b, m - b)))

+from bisect import bisect_left + -b = [0 + (i in a) for i in range(n + 1)] -print((min(sum(b[:x]), sum(b[x:])))) +b = bisect_left(a, x) +print((min(b, m - b)))