#include <bits/stdc++.h>
using namespace std;
const int SZ = 1e5 + 10;
int n, A[SZ], B[SZ];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> A[i];
  for (int i = 0; i < n; i++) cin >> B[i];
  long long int ans = 0;
  for (int i = 0; i < n; i++) {
    if (B[i] > A[i] * 2LL)
      ans--;
    else {
      if (B[i] % 2 == 0) {
        ans = ans + (B[i] / 2) * 1LL * (B[i] / 2);
      } else {
        if (B[i] == 1)
          ans--;
        else
          ans = ans + (B[i] / 2) * 1LL * (B[i] / 2 + 1);
      }
    }
  }
  cout << ans;
  return 0;
}
