#include <bits/stdc++.h>
using namespace std;
int main()
{
long long n,x;
cin>>n>>x;
long long a[n],temp;
long long mn=INT_MAX;
for(temp=0;temp<n;temp++)
{
cin>>a[temp];
mn=min(mn,a[temp]);
}
long long sum=0;
for(temp=0;temp<n;temp++)
{
if(a[temp]<mn + x)
{
sum+=a[temp];
}
else sum+=mn+x;
}
cout<<sum<<"\n";
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKCWxvbmcgbG9uZyBuLHg7CgljaW4+Pm4+Png7Cglsb25nIGxvbmcgYVtuXSx0ZW1wOwoJbG9uZyBsb25nIG1uPUlOVF9NQVg7Cglmb3IodGVtcD0wO3RlbXA8bjt0ZW1wKyspCgl7CgkJY2luPj5hW3RlbXBdOwoJCW1uPW1pbihtbixhW3RlbXBdKTsKCX0KCWxvbmcgbG9uZyBzdW09MDsKCWZvcih0ZW1wPTA7dGVtcDxuO3RlbXArKykKCXsKCQlpZihhW3RlbXBdPG1uICsgeCkKCQl7CgkJCXN1bSs9YVt0ZW1wXTsKCQl9CgkJZWxzZQlzdW0rPW1uK3g7Cgl9Cgljb3V0PDxzdW08PCJcbiI7Cn0=