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