def main():

    N, M, X = list(map(int, input().split()))

    A = [int(a) for a in input().split()]

    costL = 0

    for i in range(len(A)):

        if A[i] < X:

            costL += 1

    return min(costL, M-costL)

    

if __name__ == '__main__':

    print((main()))
def main():



    N, M, X = list(map(int, input().split()))

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

    A.sort()

    count1 = 0

    for i in range(M):

        if A[i] < X: count1 += 1

    return min(count1, len(A)-count1)







if __name__ == '__main__':

    print((main()))

def main():
    N, M, X = list(map(int, input().split()))
    A = [int(a) for a in input().split()]
    costL = 0
    for i in range(len(A)):
        if A[i] < X:
            costL += 1
    return min(costL, M - costL)


if __name__ == "__main__":
    print((main()))

def main():
    N, M, X = list(map(int, input().split()))
    A = list(map(int, input().split()))
    A.sort()
    count1 = 0
    for i in range(M):
        if A[i] < X:
            count1 += 1
    return min(count1, len(A) - count1)


if __name__ == "__main__":
    print((main()))

-    A = [int(a) for a in input().split()] -    costL = 0 -    for i in range(len(A)): +    A = list(map(int, input().split())) +    A.sort() +    count1 = 0 +    for i in range(M): -            costL += 1 -    return min(costL, M - costL) +            count1 += 1 +    return min(count1, len(A) - count1)