import std.stdio, std.conv, std.string, std.range, std.algorithm, std.array,
  std.functional, std.container, std.typecons;

void main() {
  int N = readln.chomp.to!int;
  int[] d = readln.split.to!(int[]);

  d.sort();
  int l = d[(N / 2) - 1], r = d[N / 2];
  max(0, r - l).writeln;
}
