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

A = [int(i) for i in input().split() if int(i) < x]

print((min(len(A), m - len(A))))
n, m, x = list(map(int, input().split()))

A = [int(i) for i in input().split() if int(i) < x]

print((len(A) if m - len(A) > len(A)  else m - len(A)))
n, m, x = list(map(int, input().split()))
A = [int(i) for i in input().split() if int(i) < x]
print((min(len(A), m - len(A))))

n, m, x = list(map(int, input().split()))
A = [int(i) for i in input().split() if int(i) < x]
print((len(A) if m - len(A) > len(A) else m - len(A)))

-print((min(len(A), m - len(A)))) +print((len(A) if m - len(A) > len(A) else m - len(A)))