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