n,D,T=map(int,input().split()) x=list(map(int,input().split())) x.sort() r={} for v in x: if v%D not in r: r[v%D]=[] r[v%D]+=[(v-(v%D))//D] c=0 for i in r: z=[] for v in r[i]: z+=[v-T,v+T+1] z=sorted(set(z)) d={v:j for j,v in enumerate(z)} q=[0]*len(z) for v in r[i]: q[d[v-T]]+=1 q[d[v+T+1]]-=1 for j in range(1,len(q)): q[j]+=q[j-1] c+=sum(z[j+1]-z[j] for j in range(len(q)) if q[j]!=0) print(c)