#include <bits/stdc++.h>
using namespace std;
const int Maxn = 100005;
int n;
int a[Maxn], b[Maxn];
long long res;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < n; i++) {
    scanf("%d", &b[i]);
    if (2 * a[i] >= b[i] && b[i] != 1) {
      long long prt1 = b[i] / 2;
      long long prt2 = b[i] - prt1;
      res += prt1 * prt2;
    } else
      res--;
  }
  printf("%I64d\n", res);
  return 0;
}
