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