from collections import * N, D, T = map(int, input().split()) DD = defaultdict(list) X = list(map(int, input().split())) for x in X: r = x % D DD[r].append((x - r)//D) ans = 0 for k, lst in DD.items(): pre = -10**18 lst.sort() for v in lst: ans += min(2 * T + 1, v - pre) pre = v print(ans)