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