#include <bits/stdc++.h>
int main() {
  int n, i;
  long long int a[100100], b[100100], sum;
  while (scanf("%d", &n) != EOF) {
    sum = 0;
    for (i = 0; i < n; i++) scanf("%I64d", &a[i]);
    for (i = 0; i < n; i++) scanf("%I64d", &b[i]);
    for (i = 0; i < n; i++) {
      if (b[i] == 1)
        sum--;
      else if (a[i] * 2 < b[i])
        sum--;
      else {
        if (b[i] % 2 == 0)
          sum = sum + (b[i] / 2) * (b[i] / 2);
        else
          sum = sum + (b[i] / 2) * (b[i] / 2 + 1);
      }
    }
    printf("%I64d\n", sum);
  }
  return 0;
}
