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