#include <stdio.h>

int main(void)
{
	int n;
	int min, max;
	double sum;

	scanf("%d", &n);

	int num;
	int pointer=0;
	scanf("%d", &num);
	min=max=sum=num;
	for(int i=0; i<n-1; i++){
		scanf("%d", &num);
		if(min>num) min=num;
		if(max<num) max=num;
		sum+=num;
	}

	printf("%d %d %.0lf\n", min, max, sum);

	return 0;
}
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
using namespace std;


int main() {
	int N, T;
	cin >> N >> T;

	long long X = 0;
	long long preT = 0;
	cin >> preT;
	for (int i = 0; i < N - 1; ++i) {
		int t; cin >> t;
		if (preT + T < t) {
			X += T;
		}
		else {
			X += (t - preT);
		}

		preT = t;
	}

	cout << X + T << endl;

	return 0;
}