//#pragma GCC optimize("O3,unroll-loops")
///#pragma GCC optimize("Ofast")
#include <vector>
//#pragma GCC target("avx2")
#include <bits/stdc++.h>

using namespace std;

#define int long long
using ld = long double;

mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());

int mod = 998244353;

int binpow(int x, int n) {
    if (n == 0) {
        return 1;
    }
    if (n % 2 == 0) {
        return binpow(x*x%mod, n/2);
    }
    return binpow(x*x%mod, n/2) * x % mod;
}

vector <vector <int>> v2;
vector <int> v1;
vector <int> used;

void make(int n) {
    if (n == 0) {
        v2.push_back(v1);
    }
    for (int i = -1; i < n; i++) {
        if (i == -1 || used[i]) {
            v1.push_back(i);
            make(n-1);
            v1.pop_back();
        }
    }
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector <int> a(n), b(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> b[i];
    }
    vector <int> p(n);
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }
    vector <int> pref(n+1, 0);
    vector <int> pref1(n+1, 0);
    for (int i = 0; i < n; i++) {
        pref[i+1] = pref[i] + a[i];
    }
    for (int i = 0; i < n; i++) {
        pref1[i+1] = pref1[i] + b[i];
    }
    int ans = 0;
    for (int i = 0; i < n; i++) {
        ans += a[i] + b[i] * i;
    }
    cout << ans;
    return 0;
    for (int i = 0; i < n; i++) {
        if (p[i] == -1) {
            continue;
        }
//        ans += pref[p[i]] - pref[k];
//        ans += (pref1[p[i]] - pref1[k]) * (p[i] - k);
 //       k = p[i];
    }
    cout << ans;
}
