#include <bits/stdc++.h>
using namespace std;
int A[10005], B[10005];
long long int dp[10005];
int main() {
  int n, C;
  scanf("%d %d", &n, &C);
  for (int i = 0; i < n; i++) scanf("%d", &A[i]);
  for (int i = 0; i < n; i++) scanf("%d", &B[i]);
  for (int i = n - 1; i >= 0; i--) {
    for (int j = n; j >= 0; j--) {
      dp[j] += (long long int)j * (long long int)C + B[i];
      if (j > 0) dp[j] = min(dp[j], dp[j - 1] + A[i]);
    }
  }
  long long int ret = dp[0];
  for (int j = 0; j <= n; j++) ret = min(ret, dp[j]);
  printf("%lld\n", ret);
  return 0;
}
