#include <bits/stdc++.h>
using namespace std;
const int base = 1e9;
const int maxn = 10;
const int logn = 20;
const int inf = 2e9;
const int alpha = 26;
const int my_hash = 29;
const int my_mod = 2495828519;
const long long l_inf = 4e18;
const long long mod = 1e9 + 7;
const double pi = acos(-1.0);
const double eps = 1e-9;
int main() {
  int n;
  long long ans = 0;
  scanf("%d", &n);
  vector<int> a(n), b(n);
  for (int i = int(0); i < int(n); i++) scanf("%d", &a[i]);
  for (int i = int(0); i < int(n); i++) scanf("%d", &b[i]);
  for (int i = int(0); i < int(n); i++) {
    int x = b[i] / 2;
    int y = b[i] - x;
    b[i] == 1 || max(x, y) > a[i] ? ans-- : ans += x * 1ll * y;
  }
  printf("%I64d", ans);
}
