#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
int a[maxn], b[maxn];
int main() {
  ios_base::sync_with_stdio(false);
  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 int ans = 0;
  for (int i = 0; i < n; i++) {
    long long int x = b[i] / 2, y = b[i] - x;
    if (1 <= x && x <= a[i] && 1 <= y && y <= a[i])
      ans += x * y;
    else
      ans--;
  }
  cout << ans << endl;
  return 0;
}
