import java.util.*; public class Main { static final int BASE = 1000000000; public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int d = sc.nextInt(); long t = sc.nextInt(); HashMap> ameba = new HashMap<>(); for (int i = 0; i < n; i++) { int x = sc.nextInt() + BASE; int mod = x % d; int div = x / d; if (!ameba.containsKey(mod)) { ameba.put(mod, new TreeSet<>()); } ameba.get(mod).add(div); } long ans = 0; for (TreeSet set : ameba.values()) { int left = -1; int right = -1; for (int x : set) { if (left == -1) { left = x; right = x; continue; } if (x - right > 2 * t) { ans += right - left + 1 + 2 * t; left = x; right = x; } else { right = x; } } ans += right - left + 1 + 2 * t; } System.out.println(ans); } }