using System; class Program { public static void Main(string[] args) { var firstline = Console.ReadLine().Split(' '); var n = long.Parse(firstline[0]); var d = long.Parse(firstline[1]); var t = long.Parse(firstline[2]); var secondline = Console.ReadLine().Split(' '); var points = new long[n]; var counted = new bool[n]; for (long i = 0; i < n; i++) { points[i] = long.Parse(secondline[i]); } long count = 0; for (long i = 0; i < n; i++) { if (counted[i]) { continue; } counted[i] = true; count += 2*t + 1; for (long k = i + 1; k < n; k++) { if ((points[k] - points[i])%d != 0) { continue; } var distance = Math.Abs(points[k] - points[i]) / d; if (distance > 2 * t) { continue; } counted[k] = true; count += distance + Math.Max(0, distance - t); } } Console.WriteLine(count); } }