'use strict';

Array.prototype._sort = Array.prototype.sort;
Array.prototype.sort = function(fn) {
	if (fn) {
		return this._sort(fn);
		
	} else if (typeof this[0] === 'number') {
		return this._sort((a, b) => a - b);

	} else {
		return this._sort();
	}
};

const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n');
const N = Number(lines[0]);
const L = lines[1].split(' ').map(Number);

let result = L.sort().reduce((s, v, i) => {
	if ((i & 1) === 0) {
		s += v;
	}
	
	return s;
}, 0);

console.log(result);