#include <bits/stdc++.h>
using namespace std;
int m, k;
int d[1111];
int s[1111];
int l[1111];
int main() {
  cin >> m >> k;
  int n = m + 1;
  for (int i = (0); i < (m); i++) scanf("%d", d + i);
  for (int i = (0); i < (m); i++) scanf("%d", s + i);
  for (int i = n; i >= 0; i--) l[i] = l[i + 1] + d[i];
  int curr_f = s[0];
  int curr_p = 0;
  int res = 0;
  int curr_b = s[0];
  while (1) {
    if (curr_p == n - 1) break;
    if (d[curr_p] <= curr_f)
      res += d[curr_p], curr_f -= d[curr_p], curr_p++,
          curr_b = max(curr_b, s[curr_p]), curr_f += s[curr_p];
    else
      res += k, curr_f += curr_b;
  }
  cout << res << endl;
  return 0;
}
