#include #include #include #include #include #include #define rep(x,to) for(int (x)=(0);(x)<(to);(x)++) using namespace std; typedef long long ll; int main() { ll N, D, T, res=0; cin >> N >> D >> T; vector X(N); rep(i,N) cin >> X[i]; sort(X.begin(), X.end()); vector am(N); set st; rep(i,N){ am[i]=(X[i]+1000000000LL)%D; st.insert(am[i]); } for(auto x: st){ ll oldmx=-1*1LL<<61; rep(i,N) if(x==am[i]){ if(oldmx < X[i] - D * T) res += 2*T+1; else res += (oldmx - (X[i] - D*T))/ D; oldmx = X[i] + D*T; //printf("%lld:%lld:%lld, ",res,X[i],oldmx); } } cout << res << endl; return 0; }