#include <bits/stdc++.h>
using namespace std;

#define fi  first
#define se  second
#define mp  make_pair
#define pb  push_back
#define pf  push_front
#define in  insert

#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define grtsrt(v) sort(v.begin(),v.end(),greater<ll>())
#define all(v) v.begin(),v.end()
#define mnv(v) *min_element(v.begin(),v.end())
#define mxv(v) *max_element(v.begin(),v.end())
#define For(i,j,k) for(ll i=j;i<k;i++)
#define Rev(i,j,k) for(ll i=j;i>=k;i--)
#define Rep(i,k)   for(ll i=0;i<k;i++)

#define mnn (long long) -1000000000000000
#define mxn (long long) 1000000000000000
#define eps 1e-9
#define MOD 1000003
#define inf 0x3f3f3f3f3f3f

typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vll;
typedef map<ll, ll> mll;
typedef pair<ll, ll> pll;
typedef pair<ll, bool> plb;

#define vin(v) for (ll i = 0; i < v.size(); ++i) cin >> v[i];
#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define sd(x) scanf("%lf",&x)
#define sdd(x,y) scanf("%lf%lf",&x,&y)
#define sddd(x,y,z) scanf("%lf%lf%lf",&x,&y,&z)
#define ss(str) scanf("%s",str)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ss) printf("%s",ss)

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define input freopen("input.txt", "r", stdin)
#define output freopen("output.txt", "w", stdout)
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);


const int maxn  =     1000005;
const double pi =     2.0*acos(0.0);
const double EPS=     1e-11;




ll sumDigit(ll n)
{
    if (n == 0)
       return 0;
    return (n % 10 + sumDigit(n / 10));
}
ll _pow(ll n,ll mod)
{
     if(n==0) return 1;
     ll k=_pow(n/2,mod);
     k=(k*k)%mod;
     if(n%2) k=(k*2)%mod;
     return k;
}
ll toNum(string s)
{
    ll ret = 0, sig = 1, i=0;
    if(!s.empty() && s[0] == '-') sig = -1, i++;
    while(i < s.size() && s[i] >= '0' && s[i] <= '9')
        ret = ret * 10 + (s[i++] - '0');
    return ret*sig;
}
string toStr(ll x)
{
    string s = "";
	if (x == 0) return "0";
	while(x > 0)
	{
		s = (char)('0' + (x % 10)) + s;
		x /= 10;
	}
	return s;
}


///Direction
/*
ll row,col;
#define valid0(x,y) x<0 || x>=row || y<0 || y>=col
#define valid1(nx,ny) nx>=1 && nx<=row && ny>=1 && ny<=col
ll fx[]={1,-1,0,0}; //4 side 2d
ll fy[]={0,0,1,-1};
//ll fx[]={+0,+0,+1,-1,-1,+1,-1,+1}; //8 side 2d
//ll fy[]={-1,+1,+0,+0,+1,+1,-1,-1};
//ll dx[] = {-2, -2, -1, -1, +1, +1, +2, +2};//Knight move
//ll dy[] = {-1, +1, -2, +2, -2, +2, -1, +1};

*/
/*

vector<char> vc;
ll lcs(ll x , ll y)
{
    if(x== 0 or y==0) return 0;
    else if(s[x-1]==t[y-1]) {vc.pb(s[x-1]); return 1+lcs(x-1,y-1);}
    else return max(lcs(x-1,y),lcs(x,y-1));
}
*/

set <ll> primes;

ll arr[1005];
void sieve()
{


    arr[0]=1;
    arr[1]=1;
    for(ll i = 2 ; i*i< 1000; i++)
    {
        if(arr[i]==0)
        {
            for(ll j = i*2; j< 1000 ; j+=i)
            {
                arr[j]=1;
                //cout<<j<<endl;
            }
        }
    }
    For(i,0,1001)
    {
        if(arr[i]==0)
            primes.in(i);
    }
}
void getDigits(ll numb , vector<ll> &vec)
{
    while(numb!=0)
    {
        vec.pb(numb%10);
        numb/=10;
    }
}

/*
void nod(ll numb)
{

    ll x=0;
    ll nod=1;
    while(numb>1)
    {
        ll cnt=0;
        if(numb%primes[x]==0)
        {

            while(numb%primes[x]==0)
            {
                numb=numb/primes[x];
                cnt++;
            }
            x++;
        }
        else
            x++;

            cout<<primes[x]<<" "<<cnt<<endl;
        nod*=cnt+1;
    }
    cout<<nod<<endl;
}
*/
///Needed variables and arrays
///I am such a bad person to keep them outside from all functions and using them continuously :p such selflessness xD
const int N=200;
ll a,b,c,d,e,f,n,ans;
string s , t;
vector<ll> vec;
string S[N+2];
ll id[N+2],res[N+2];

void solve()
{

}
void read()
{
    cin>>a;
    vec.resize(a+a);
    vin(vec);
    srt(vec);
    For(i,0,a+a)
    {
        ans+= min(vec[i],vec[i+1]);
        i++;
    }
    cout<<ans<<endl;

}



int main()
{
  //fast_io;
  read();
}


Measured memory_bytes: 256