#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n, m, t;
    cin >> n >> m >> t;
    vector<int> v;
    for (int i = 0; i < n; ++i) {
        int a;
        cin >> a;
        v.push_back(a);
    }

    int count = 0;
    count += v[0] - m;
    for (int i = 0; i < n - 1; ++i) {
        if (v[i + 1] - v[i] > 2 * m) {
            count += v[i + 1] - v[i] - 2 * m;
        }
    }
    count += max(t - v.back() - m, 0);
    cout << count << endl;
}
