function Main(input) {
	var list = input.split("\n")[1].split(" ");
   var output = 0;
  list.sort(function(a,b){
  	return parseInt(b) - parseInt(a);
  });
  while(list.length > 0){
    var first = list.shift();
    var second = list.shift();
    var end = list.pop();
    output += parseInt(second);
  }
  console.log(output);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
