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