#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long a[n], b[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) cin >> b[i];
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    if (b[i] == 1)
      sum -= 1;
    else {
      long long sum1 = b[i] / 2;
      long long sum2 = b[i] - sum1;
      if (sum1 <= a[i] && sum2 <= a[i])
        sum += (sum1 * sum2);
      else
        sum -= 1;
    }
  }
  cout << sum;
}
