n, d, t = map(int, input().split()) pos = {} X = list(map(int, input().split())) for x in X: p = x % d x //= d mi = x - t ma = x + t if p not in pos: pos[p] = {} pos[p][mi] = pos[p].get(mi, 0) + 1 pos[p][ma + 1] = pos[p].get(ma + 1 , 0) - 1 ans = 0 for dic in pos.values(): bef = -1 tot = 0 for k in sorted(dic.keys()): v = dic[k] if tot > 0: ans += k - bef bef = k tot += v print(ans)