import static java.util.Arrays.deepToString;

import java.io.*;
import java.util.*;

public class trafficjam_nn {

	static final int MAXN = 1000;
	static final int MAXL = 1000000000;

	static void solve() throws Exception {
		int n = nextInt();
		int g = nextInt();
		int r = nextInt();
		assert 1 <= n && n <= MAXN;
		assert 1 <= g && g <= MAXL;
		assert 1 <= r && r <= MAXL;
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		long curTime = 0;
		for (int i = 0; i < n; i++) {
			int wait = timeToWait(curTime, g, r);
			curTime += wait;
			wait = timeToGo(curTime, g, r);
			if (wait < a[i]) {
				curTime += wait + r;
			}
			curTime += a[i];
		}
		out.println(curTime);
	}

	static int timeToWait(long t, int g, int r) {
		int mod = (int) (t % (g + r));
		if (mod <= g) {
			return 0;
		}
		return g + r - mod;
	}
	
	static int timeToGo(long t, int g, int r) {
		int mod = (int) (t % (g + r));
		if (mod <= g) {
			return g - mod;
		}
		return 0;
	}

	static BufferedReader br;
	static StringTokenizer st;
	static PrintWriter out;

	static void debug(Object... a) {
		System.err.println(deepToString(a));
	}

	static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	static String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String line = br.readLine();
			if (line == null) {
				return null;
			}
			st = new StringTokenizer(line);
		}
		return st.nextToken();
	}

	static long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	public static void main(String[] args) {
		try {
			File file = new File("trafficjam.in");
			InputStream input = System.in;
			OutputStream output = System.out;
			if (file.canRead()) {
				input = (new FileInputStream(file));
				output = (new PrintStream("trafficjam.out"));
			}
			br = new BufferedReader(new InputStreamReader(input));
			out = new PrintWriter(output);
			solve();
			out.close();
			br.close();
		} catch (Throwable e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}
