#include <iostream>
#define NMAX 100000
using namespace std;

int min[NMAX], max[NMAX];
long long c[NMAX], dp[NMAX];
int n;
long long e, t;

long long mxm(long long a, long long b);

int main()
{
	cin >> n >> e >> t;
	int prec = -1e9, m = 0, cit;

	while (n--) {
		cin >> cit;
		if (cit - prec > t) {
			m++;
			min[m] = cit;
		}
		max[m] = cit;
		prec = cit;
	}

	for (int i = 1; i <= m; i++)
		c[i] = mxm(2ll * (max[i] - min[i]), t) + max[i] - min[i];

	for (int i = 1; i <= m; i++)
		dp[i] = dp[i - 1] + c[i] + 1ll * (min[i] - max[i - 1]);

	cout << (long long) dp[m] + e - max[m];

	return 0;
}

long long mxm(long long a, long long b)
{
	if (a > b)
		return a;
	return b;
}
