I=lambda:list(map(int,input().split()));n,m,x=I();s=sum(a<x for a in I());print((min(s,m-s)))
n,m,*a=list(map(int,open(0).read().split()));print((min(c:=sorted(a).index(a[0]),m-c)))
I = lambda: list(map(int, input().split()))
n, m, x = I()
s = sum(a < x for a in I())
print((min(s, m - s)))

n, m, *a = list(map(int, open(0).read().split()))
print((min(c := sorted(a).index(a[0]), m - c)))

-I = lambda: list(map(int, input().split())) -n, m, x = I() -s = sum(a < x for a in I()) -print((min(s, m - s))) +n, m, *a = list(map(int, open(0).read().split())) +print((min(c := sorted(a).index(a[0]), m - c)))