#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Ti = tuple<int, int, int>;
using Tl = tuple<ll, ll, ll>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#define Get(t, i) get<(i)>((t))
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, f, n) for(int i = (int)(f); i < (int)(n); i++)
#define each(a, b) for(auto& a : b)

const int inf = 1 << 25;
const ll INF = 1LL << 55;

int main()
{
  int N, M, T;
  cin >> N >> M >> T;
  int ans = 0;
  int a[111];
  a[0] = 0;
  rep(i, N) {
    cin >> a[i+1];
    if(i == 0) ans += a[i+1] - M;
    else if(a[i+1] - a[i] > 2*M) ans += (a[i+1]-a[i]) - 2*M;
  }
  cout << ans + max(0, T-a[N]-M) << endl;
  return 0;
}