#include <bits/stdc++.h>

typedef long long LL;

const int MAXN = 1e5 + 10;

int n, m;
int a[MAXN], b[MAXN];

int main() {
	scanf("%d", &n), m = n >> 1;
	for (int i = 1; i <= n; ++i) scanf("%d", a + i);
	for (int i = 1, x; i <= n; ++i) {
		scanf("%d", &x);
		if (i & 1) b[i / 2 + 1] = x - a[i];
		else b[i / 2 + m] = x - a[i];
	}
	std::sort(b + 1, b + m + 1), std::sort(b + m + 1, b + n + 1);
	LL sum = std::accumulate(a + 1, a + n + 1, 0LL);
	for (int i = 1; i <= m; ++i) sum += std::max(b[i] + b[i + m], 0);
	printf("%lld\n", sum);
	return 0;
}
#include <bits/stdc++.h>
using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef pair<int, int> pi;

string s;
int n, m;

ll odd, even;

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    odd = 0, even = 0;
    cin >> n >> m;
    for(int i = 1;i <= n;i++){
        cin >> s;
        int cnt = 0;
        for(int i = 0;i < s.length();i++){
            cnt += s[i] - '0';
        } 
        if(cnt & 1){
            odd++;
        }else{
            even++;
        }
    }
    cout << odd * even << endl;
    return 0;
}
