#include <bits/stdc++.h>
using namespace std;
#define C getchar()-48
const int N=1e4;
    int n,s;
	int a[N];
	
inline int read()
{
    int s=0,t=1,k=C;
  for (;k>9||k<0;k=C) if (k==-3) t=-1;
  for (;k>=0&&k<=9;k=C) s=(s<<1)+(s<<3)+k;
  return s*t;
}

int main()
{
  n=2*read();
  for (int i=0;++i<=n;)
    a[i]=read();
  sort(a+1,a+n+1);
  for (int i=1;i<=n;i+=2)
    s+=a[i];
  cout<<s;
  return 0;
}