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

M min(M, N)(M m, N n) if (is(typeof(m < n))) {
  return m < n ? m : n;
}

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

  std.algorithm.sort!"a>b"(L);

  int answer;

  foreach (i; 0..(L.length / 2)) {
    answer += min(L[i*2], L[i*2 + 1]);
  }

  writeln(answer);
}
