from collections import defaultdict def solve(): N, D, T = map(int, input().split()) X = list(map(int, input().split())) def count(ys): if len(ys) == 0: return 0 mi = ys[0] ma = ys[-1] return 2 * T + 1 + ma - mi groups = defaultdict(list) for x in X: groups[x % D].append(x // D) ans = 0 for m in groups: xs = groups[m] xs.sort() p = -float('inf') ys = [] for x in xs: if abs(p - x) <= T: ys.append(x) else: ans += count(ys) ys = [x] p = x ans += count(ys) print(ans) if __name__ == '__main__': solve()