import std.stdio, std.string, std.array, std.conv, std.algorithm;

void main() {
    int n = readln.chomp.to!int;
    int[] d = readln.split.to!(int[]).sort!("a < b").array;
    writeln(d[n/2] - d[n/2-1]);
}