#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 100;
int a[MAXN], b[MAXN];
int main() {
  long long joy = 0;
  int n;
  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 (b[i] > 2 * a[i] or b[i] == 1)
      joy--;
    else {
      int x = b[i] / 2;
      long long y = b[i] - x;
      joy += x * y;
    }
  cout << fixed << joy << endl;
  return 0;
}
