#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int N = 200010;
int a[N * 2], id[N * 2], fa[N];
bool cmp(int x, int y) { return a[x] < a[y]; }
static int get(int x) {
if (x == fa[x]) return x;
return fa[x] = get(fa[x]);
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n;cin >> n;
for (int i = 3; i <= n * 2 - 1; i ++ ) cin >> a[i];
for (int i = 3; i <= n * 2 - 1; i ++ ) id[i] = i;
for (int i = 1; i <= n; i ++ ) fa[i] = i;
sort(id + 3, id + n * 2, cmp);
int num = 0;
long long ans = 0;
for (register int i = 3; i <= n * 2 + 1; i ++ ) {
int u = id[i], ad = 0;
for (register int j = max(1, u - n); j <= u / 2; j ++ ) {
if (get(j) != get(u - j)) fa[get(j)] = get(u - j), ans += a[u], num ++, ad = -1e4;
else ad ++;
if (ad == 50) break;
}
u = id[i], ad = 0;
for (register int j = u / 2; j >= max(1, u - n); j -- ) {
if (get(j) != get(u - j)) fa[get(j)] = get(u - j), ans += a[u], num ++, ad = -1e4;
else ad ++;
if (ad == 50) break;
}
if (num == n - 1) break;
}
cout << ans;
return 0;
}