#include <bits/stdc++.h>
using namespace std;
int n, m, ans, now, top;
int d[1100], s[1100];
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%d", &d[i]);
    for (int i = 1; i <= n; i++) scanf("%d", &s[i]);
    ans = 0;
    now = top = s[1];
    for (int i = 1; i <= n; i++) {
      while (now < d[i]) {
        now += top;
        ans += m;
      }
      now += s[i + 1] - d[i];
      ans += d[i];
      top = max(top, s[i + 1]);
    }
    printf("%d\n", ans);
  }
  return 0;
}
