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

7c21e70f442b46004f824941b64e510a4213d0b6
<mask token>

<mask token>
print(min(b, m - b))

<mask token>
n, m, x = 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
n, m, x = map(int, input().split())
a = list(map(int, input().split()))
b = bisect_left(a, x)
print(min(b, m - b))
