n, k, x = map(int, input().split()) A = list(map(int, input().split())) a, b = 0, x for i in A: a, b = min(a, b)+i, min(a+x, b) + k print(min(a, b))