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

void main ()
{
	int n;
	while (readf (" %s", &n) > 0)
	{
		readln;
		auto a = readln.split.map !(to !(int)).array;
		sort (a);
		int res = 0;
		for (int i = 0; i < cast (int) a.length; i += 2)
		{
			res += a[i];
		}
		writeln (res);
	}
}
