#include <bits/stdc++.h>

#define rep(i, n) for(int i = 0 ; i < (int)(n) ; i++)
typedef long long ll;
typedef long double Double;

#ifndef INPUTS_DIR
#define INPUTS_DIR "./"
#endif

namespace stream {
    template<class T>
    class Stream {
    public:
        std::vector<T> instance;

        Stream(const std::vector<T> &instance) : instance(instance) {}


        template<class F>
        Stream<T> filter(const F &func) {
            return filterPrivate([&](T &t, int &idx) { return func(t); });
        }

        template<class F>
        Stream<T> filterWithIndex(const F &func) {
            return filterPrivate(func);
        }

        template<class F, class R>
        Stream<R> map(const F &func) {
            return mapPrivate([&](T &t, int &idx) { return func(t); });
        }

        template<class F, class R>
        Stream<R> mapWithIndex(const F &func) {
            return mapPrivate(func);
        }

        template<class F, class R>
        R reduce(const F &func, const R &init_value) {
            R ans = init_value;
            for (int i = 0; i < instance.size(); i++) {
                ans = func(ans, instance[i]);
            }
            return ans;
        }

        template<class F>
        Stream<T> sort(F cmp) {
            std::vector<T> v = instance;
            std::sort(v.begin(), v.end(), cmp);
            return Stream<T>(v);
        }

        Stream<T> sort() {
            std::vector<T> v = instance;
            std::sort(v.begin(), v.end());
            return Stream<T>(v);
        }

        Stream<T> sort_reversed() {
            std::vector<T> v = instance;
            std::sort(v.rbegin(), v.rend());
            return Stream<T>(v);
        }

        Stream<T> unique() {
            std::unordered_set<T> existing;
            std::vector<T> ans;
            for (auto &&i : instance) {
                if (existing.count(i)) { continue; }
                existing.insert(i);
                ans.push_back(instance[i]);
            }
            return Stream<T>(ans);
        }

        unsigned long count() {
            return instance.size();
        }

        T sum() {
            return std::accumulate(instance.begin(), instance.end(), T());
        }

    private:
        template<class F>
        Stream<T> filterPrivate(F func) {
            std::vector<T> ans;

            for (int i = 0; i < instance.size(); i++) {
                if (func(instance[i], i)) {
                    ans.push_back(instance[i]);
                }
            }
            return Stream<T>(ans);
        }

        template<class F, class R>
        Stream<R> mapPrivate(F func) {
            std::vector<R> ans;
            for (int i = 0; i < instance.size(); i++) {
                ans.push_back(func(instance[i], i));
            }
            return Stream<R>(ans);
        }

    };

    template<class T>
    Stream<T> _(const std::vector<T> &instance) {
        return Stream<T>(instance);
    };

    template<class T>
    Stream<T> _(const std::set<T> &instance) {
        return Stream<T>(std::vector<T>(instance.begin(), instance.end()));
    };
}

using namespace std;
using namespace stream;


void solve(ll N, vector<ll> L) {
    cout << _(L)
            .sort_reversed()
            .filterWithIndex([&](ll a, int i) { return i % 2; })
            .sum() << endl;
}


void main_(istream &cin) {
    ll N;
    cin >> N;
    vector<ll> L(2 * N - 1 + 1);
    for (int i = 0; i <= 2 * N - 1; i++) {
        cin >> L[i];
    }
    solve(N, L);
}

int main() {
#ifdef INTELLIJ
    ifstream ifs(string(INPUTS_DIR) + "in_1.txt");
    if (ifs.is_open()) {
        main_(ifs);
        ifs.close();
    } else {
        cerr << "Error: no input." << endl;
    }
#else
    ios::sync_with_stdio(false);
    cin.tie(0);
    main_(cin);
#endif
}





Measured memory_bytes: 256