from collections import defaultdict def Check(X, T): N = len(X) L = X[0] - T R = X[0] + T ret = 0 for i in range(1,N): if L <= X[i] - T <= R: R = X[i] + T else: ret += R - L + 1 L = X[i] - T R = X[i] + T ret += R - L + 1 return ret N,D,T = map(int,input().split()) X = list(map(int,input().split())) X.sort() mod = defaultdict(list) for i in range(N): mod[X[i]%D].append(X[i]//D) ans = 0 for V in mod.values(): ans += Check(V, T) print(ans)