#include <bits/stdc++.h>
using namespace std;
long long i, j, m, n, p, q, r, l, c, x, y, a[200005], b[200005], s;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  for (i = 1; i <= n; i++) {
    cin >> b[i];
    p = ceil(b[i] / 2.0);
    if (p <= a[i] && b[i] > 1) {
      p = b[i] / 2;
      s += (p * (b[i] - p));
    } else
      s--;
  }
  cout << s;
}
