import std.stdio;

void main(){
	auto cin = new Cin();
	
	cin.line();
	auto L = cin.line();
	L.sort();
	size_t ans = 0;
	
	for( size_t i=0 ; i<L.length ; i+=2 ){
		ans += ( L[i] < L[i+1] ) ? L[i] : L[i+1] ;
	}
	writeln(ans);
}

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

class Cin
{
	auto line( T = size_t )( string token = " " ){
		T[] arr;
		foreach( elm ; readln().chomp().split(token) ){
			arr ~= elm.to!T();
		}
		return arr;
	}
	/*auto rect( T = size_t )( string token = " " ){
		T[][] arr;
		arr = new
	}*/
}
