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