#include <bits/stdc++.h>
using namespace std;
int n, m;
long long x[1000005], y[1000005];
int main() {
  while (~scanf("%d", &n)) {
    long long ans = 0;
    for (int i = 0; i < n; i++) cin >> x[i];
    for (int i = 0; i < n; i++) cin >> y[i];
    for (int i = 0; i < n; i++) {
      if (x[i] * 2 < y[i] || y[i] == 1)
        ans--;
      else {
        if (y[i] % 2 == 1)
          ans += (y[i] / 2) * (y[i] / 2 + 1);
        else
          ans += y[i] * y[i] / 4;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
