N, K = map(int, input().split()) A = [int(a) for a in input().split()] B = [int(a) for a in input().split()] X = [0] * N if N > 1: X[1] = A[0] + B[1] for i in range(2, N): X[i] = min(X[i-2] + K + A[i-2] + B[i], X[i-1] + A[i-1] + B[i]) print(X[-1])