process.stdin.resume();
process.stdin.setEncoding('utf8');

var lines = [];
var reader = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
reader.on('line', (line) => {
  lines.push(line);
});
reader.on('close', () => {
    const N = lines[0]-0;
    const list = lines[1].split(" ").map(v=>v-0).sort((a,b)=>b-a);
    let ans = 0;
    for(let i=1;i<N*2;i+=2){
        ans += list[i];
    }
    console.log(ans);
});
