# ABC132C - Divide the Problems

from statistics import median_high, median_low





def main():

    n = int(eval(input()))

    D = sorted(map(int, input().rstrip().split()))

    h, l = median_high(D), median_low(D)

    print((h - l))





if __name__ == "__main__":

    main()
# ABC132C - Divide the Problems

def main():

    n = int(eval(input()))

    D = sorted(map(int, input().rstrip().split()))

    h, l = D[n // 2], D[n // 2 - 1]

    print((h - l))





if __name__ == "__main__":

    main()
# ABC132C - Divide the Problems
from statistics import median_high, median_low


def main():
    n = int(eval(input()))
    D = sorted(map(int, input().rstrip().split()))
    h, l = median_high(D), median_low(D)
    print((h - l))


if __name__ == "__main__":
    main()

# ABC132C - Divide the Problems
def main():
    n = int(eval(input()))
    D = sorted(map(int, input().rstrip().split()))
    h, l = D[n // 2], D[n // 2 - 1]
    print((h - l))


if __name__ == "__main__":
    main()

-from statistics import median_high, median_low - - -    h, l = median_high(D), median_low(D) +    h, l = D[n // 2], D[n // 2 - 1]