#include<bits/stdc++.h>
using namespace std;
int main()
{
long long a,b,q[10005],he=0;
cin>>a>>b;
for(int i=1;i<=a;i++)
{
cin>>q[i];
he+=q[i];
}
sort(q+1,q+1+a);
for(int i=1;i<=a;i++)
if(q[a]-q[i]>b)
he=he-q[i];
//cout<<endl;
cout<<he;
return 0;
}
thank you vvvvvvery much