#include <bits/stdc++.h>
using namespace std;
long long a[100005], b[100005];
int main() {
  int n;
  long long sum;
  while (cin >> n) {
    sum = 0;
    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 (a[i] * 2 < b[i] || b[i] == 1)
        sum--;
      else if (a[i] * 2 >= b[i]) {
        sum += (b[i] + 1) / 2 * (b[i] / 2);
      }
    }
    cout << sum << endl;
  }
  return 0;
}
