#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<vector>
#include<map>
#include<stack>
#include<set>
#include<cstdlib>
#include<deque>
#include<queue>
#include<bitset>
#include<functional>
#include<utility>
#include<list>
#include<iomanip>
#include<ctime>
#include<cassert>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long ll;
const int INF=1e9+1;
ll n,t,e,st,pos[100005],dist; 
ll ans=0;
int main()
{
	scanf("%d%d%d",&n,&e,&t);
	for(int i=0;i<n;i++) scanf("%d",&pos[i]);
	ans+=pos[0]+e-pos[n-1];
	while(st<n-1)
	{
		//cout<<"*************"<<endl;
		//cout<<st<<"*****";
		int ed=st;
		dist=0;
		for(int i=st+1;i<n;i++)
		{
			dist+=pos[i]-pos[i-1];
			//cout<<dist<<" ";
			if(dist>t)
			{
				dist-=pos[i]-pos[i-1];
				ed=i-1;
				break;
			}
			else if(i==n-1) ed=1;
		}
		ans+=3*dist;
		if(2*dist<t) ans+=(ed-st+1)*(t-dist*2);
		if(ed<n-1) ans+=pos[ed+1]-pos[ed];
		if(ed==n-2) ans+=t;
		st=ed+1;
	}
	if(n==1) ans+=t;
	printf("%lld\n",ans);
	return 0;
}