import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; import java.util.Map.Entry; import java.util.Scanner; import java.util.TreeSet; public class Main { public static long MOD = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); final long D = sc.nextLong(); final long T = sc.nextLong(); HashMap> mods = new HashMap>(); for(int i = 0; i < N; i++){ final long X = sc.nextLong(); final long mod = X % D; if(!mods.containsKey(mod)){ mods.put(mod, new TreeSet()); } mods.get(mod).add(X); } //long answer = 0; BigInteger answer = BigInteger.valueOf(0); for(final Entry> entry : mods.entrySet()){ final long mod = entry.getKey(); final ArrayList list = new ArrayList(entry.getValue()); //if(list.size() == 1){ answer += (2 * T + 1); continue; } if(list.size() == 1){ answer = answer.add(BigInteger.valueOf(2 * T + 1)); continue; } /* answer += T; //System.out.println(answer); for(int fst = 0; fst < list.size() - 1; fst++){ final int snd = fst + 1; final long diff = (list.get(snd) - list.get(fst)) / D - 1; final long min = Math.min(diff, 2 * T); answer += min + 1; } answer += T + 1; */ answer = answer.add(BigInteger.valueOf(T)); for(int fst = 0; fst < list.size() - 1; fst++){ final int snd = fst + 1; final long diff = (list.get(snd) - list.get(fst)) / D - 1; final long min = Math.min(diff, 2 * T); answer = answer.add(BigInteger.valueOf(min + 1)); } answer = answer.add(BigInteger.valueOf(T + 1)); } System.out.println(answer); } }