#include <bits/stdc++.h>
using namespace std;
int N;
int a[100010];
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  long long res = 0;
  for (int i = 0; i < N; i++) {
    int b;
    scanf("%d", &b);
    if (b < 2 || a[i] * 2 < b)
      res--;
    else {
      if (b % 2 == 0) {
        res += ((long long)b * b) / 4;
      } else {
        res += ((long long)(b + 1LL) / 2LL) * ((long long)b / 2LL);
      }
    }
  }
  cout << res << endl;
}
