#include <bits/stdc++.h>
using namespace std;
int dir1[8][2] = {1, 2, 2, 1, 2, -1, 1, -2, -1, 2, -2, 1, -1, -2, -2, -1};
int dir2[4][2] = {1, 0, 0, 1, -1, 0, 0, -1};
int dir3[8][2] = {1, 0, 0, 1, -1, 0, 0, -1, 1, 1, 1, -1, -1, 1, -1, -1};
int gcd(int x, int y) { return y == 0 ? x : gcd(y, x % y); }
bool isPrime(int x) {
  if (x == 1)
    return false;
  else if (x == 2)
    return true;
  for (int i = 2; i <= sqrt(x * 1.0); ++i) {
    if (x % i == 0) return false;
  }
  return true;
}
long long int sqr(long long int x) { return x * x; }
long long int a[1000005];
long long int b[1000005];
int main() {
  int n;
  while (~scanf("%d", &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 (2 * a[i] < b[i] || b[i] == 1)
        ans--;
      else {
        if (b[i] & 1)
          ans += (b[i] / 2) * (b[i] / 2 + 1);
        else
          ans += (sqr(b[i]) / 4);
      }
    }
    cout << ans << endl;
  }
  return 0;
}
