#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define Pr pair<ll,ll>
#define Tp tuple<int,int,int>
using Graph = vector<vector<int>>;

int main(){
    ll N; cin >> N;
    ll v[2*N]; ll sum = 0,loss = 0;
    rep(i,2*N){
        cin >> v[i]; sum += v[i];
    }
    ll k1 = N-1; ll k2 = N;
    multiset<ll> mean;
    rep(i,N){
        mean.insert(v[k1]); mean.insert(v[k2]);
        auto itr = mean.begin();
        loss += *itr; mean.erase(itr);
        k1--; k2++;
    }
    cout << sum-loss << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define test(x) cout << "Line(" << __LINE__ << ") " #x << ' ' << x << endl
#define printv(x) {\
	for (auto i : x) cout << i << ' ';\
	cout << endl;\
}
#define pii pair <int, int>
#define pll pair <lli, lli>
#define X first
#define Y second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
template<typename A, typename B>
ostream& operator << (ostream& o, pair<A, B> a){
    return o << a.X << ' ' << a.Y;
}
template<typename A, typename B>
istream& operator >> (istream& o, pair<A, B> &a){
    return o >> a.X >> a.Y;
}
const int mod = 1e9 + 7, abc = 864197532, N = 2008, logN = 17, K = 333;

lli myceil(lli a, lli b) {
    if (a <= 0) {
        return a / b;
    } else {
        return (a + b - 1) / b;
    }
}

lli myfloor(lli a, lli b) {
    if (a >= 0) {
        return a / b;
    } else {
        return (a - b + 1) / b;
    }
}

lli mysqrt(lli x) {
    lli l = 0, r = 2000000000;
    while (r - l > 1) {
        lli mid = (l + r) / 2;
        if (mid * mid <= x) l = mid;
        else r = mid;
    }
    return l;
}

lli get(){
    string t;
    cin >> t;
    string qq;
    int cnt = 0;
    bool tmp = false;
    for(char i : t){
        if(i == '.') tmp = true;
        else{
            qq += i;
            if(tmp) cnt++;
        }
    }
    for(int j = 0; j + cnt < 4; j++) qq += '0';
    return stoll(qq);
}

int main () {
    ios::sync_with_stdio(false);
    cin.tie(0);
    /*
     * (a - x)^2 + (b - y)^2 <= r^2;
     * b^2 - 2by <= r^2 - y^2 - x^2 - a^2 + 2ax
     * b^2 + Bb + C <= 0
     */
    lli x = get(), y = get(), r = get();
    lli ans = 0;

    for (lli a = -200000; a <= 200000; a++) {
        if (x - r > a * 10000 || a * 10000 > x + r) continue;
        lli val = r * r - (a * 10000 - x) * (a * 10000 - x);
        if (val < 0) continue;
        lli sq = mysqrt(val);
        lli L = myceil(y - sq, 10000), R = myfloor(y + sq, 10000);
        // cout << a << ' ' << L << ' ' << R << endl;
        ans += R - L + 1;
    }
    cout << ans << endl;
}