import sys from collections import defaultdict sys.setrecursionlimit(10**7) def I(): return int(sys.stdin.readline().rstrip()) def MI(): return map(int,sys.stdin.readline().rstrip().split()) def LI(): return list(map(int,sys.stdin.readline().rstrip().split())) def LI2(): return list(map(int,sys.stdin.readline().rstrip())) def S(): return sys.stdin.readline().rstrip() def LS(): return list(sys.stdin.readline().rstrip().split()) def LS2(): return list(sys.stdin.readline().rstrip()) N,D,T = MI() X = LI() d = defaultdict(list) for x in X: d[x % D].append(x) ans = 0 for key in d.keys(): A = d[key] A.sort() l = len(A) count = l*(2*T+1) for i in range(l-1): a,b = A[i],A[i+1] count -= max(0,2*T+1-(b-a)//D) ans += count print(ans)