#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4000000;
long long ai[MAXN], bi[MAXN];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> ai[i];
  long long sol = 0;
  for (int i = 0; i < n; i++) {
    cin >> bi[i];
    if (bi[i] == 1 || ai[i] * 2 < bi[i])
      sol--;
    else
      sol += (bi[i] / 2) * ((bi[i] / 2) + (bi[i] % 2));
  }
  cout << sol << '\n';
}
