N,K,X=map(int,input().split()) G=list(map(int,input().split())) a,b=0,X for i in G: a,b=min(a,b)+i,min(a+X,b)+K print(min(a,b))