from collections import defaultdict N, D, T = map(int, input().split()) X = map(int, input().split()) d = defaultdict(list) for x in X: d[x % D].append(x // D) ans = 0 for v in d.values(): v.sort() ans += 2 * T + 1 for i in range(len(v) - 1): ans += v[i + 1] + T - max(v[i + 1] - T - 1, v[i] + T) print(ans)