#include using namespace std; int main() { int N, D, T; cin >> N >> D >> T; map> MA; for (int x; cin >> x;) MA[(x % D + D) % D].push_back(x); int ans = 0; for (auto [a, X] : MA) { sort(X.begin(), X.end()); int pre = INT_MIN; for (auto x : X) { int l = x - D * T; int r = x + D * T; if (l < pre) ans -= (pre - l) / D + 1; ans += T * 2 + 1; pre = r; } } cout << ans << "\n"; }