#include <string>
#include <iostream>
#include <vector>

using namespace std;

int main(){
  long long int N, E, T, tot = 0;
  cin >> N >> E >> T;
  long long int x[N];

  for(int i; i<N; i++){
    tot += min(2*T+x[i+1]-x[i], 2*(x[i+1]-x[i])+ max(0, T-(x[i+1]-x[i])) + max(0, T-2*(x[i+1]-x[i]));
  }
  tot+=x[0]+(E-x[N-1]);

  cout << tot << endl;
  return 0;
}
