#include <bits/stdc++.h>
using namespace std;
const int oo = (int)1e9;
const double PI = 2 * acos(0.0);
const double EPS = 1e-9;
int main() {
  vector<long long> notes, bi;
  long long n, k, x, y, res = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> k;
    notes.push_back(k);
  }
  for (int i = 0; i < n; ++i) {
    cin >> k;
    bi.push_back(k);
  }
  for (int i = 0; i < n; ++i) {
    if (2 * notes[i] >= bi[i]) {
      if (bi[i] % 2 == 0) {
        x = y = bi[i] / 2;
      } else {
        x = bi[i] / 2;
        y = bi[i] / 2 + 1;
      }
      if (x > 0 && y > 0)
        res += x * y;
      else
        --res;
    } else {
      --res;
    }
  }
  cout << res << endl;
  return 0;
}
