#include using namespace std; typedef long long ll; typedef vector vint; typedef pair pint; typedef vector vpint; #define rep(i,n) for(int i=0;i<(n);i++) #define reps(i,f,n) for(int i=(f);i<(n);i++) #define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++) #define all(v) (v).begin(),(v).end() #define pb push_back #define mp make_pair #define fi first #define se second #define chmax(a, b) a = (((a)<(b)) ? (b) : (a)) #define chmin(a, b) a = (((a)>(b)) ? (b) : (a)) const int MOD = 1e9 + 7; const int INF = 1e9; const ll INFF = 1e18; int n; ll d, t; map> > ran; int main(void){ cin >> n >> d >> t; vector x; rep(i, n){ ll t; cin >> t; t += (ll)INF; //modとるときに負にならないように x.pb(t); } sort(all(x)); for(auto u : x){ //modをとって範囲をいれていく. ran[u % d].pb(mp(u - d * t, u + d * t)); } ll ans = 0; for(auto v : ran){ ll left = -INFF, right = -INFF; for(auto u : v.second){ ll nleft = u.fi, nright = u.se; if(nleft > right){ //連続区間でないとき if(left != -INFF) ans += (right - left) / d + 1; left = nleft; right = nright; }else{ right = nright; } } if(left != -INFF) ans += (right - left) / d + 1; } printf("%lld\n", ans); return 0; }