#include <bits/stdc++.h>
using namespace std;
long long a[100005], b[100005];
int main() {
  long long n = 0, m = 0, k = 0, l = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  for (int i = 0; i < n; ++i) {
    if (2 * a[i] < b[i] || b[i] == 1)
      --m;
    else {
      k = b[i] / 2;
      m += k * (k + b[i] % 2);
    }
  }
  cout << m;
  return 0;
}
