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

void main()
{
  int n = readln.chomp.to!int;
  int[] xs = readln.split.map!(to!int).array.sort().array;
  auto tako = zip(iota(0, xs.length), xs).filter!(a => a[0] % 2 == 0).array.map!(a => a[1]);
  writeln(sum(tako));
}
