#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
typedef long long ll;
int n, m, a[200005], b[200005];
int main() {
	std::cin >> n >> m;
	int w = 2100000000;
	for (int i = 1; i <= m; ++i) {
		std::cin >> a[i];
	}
	std::sort(a, a + m + 1);
	a[m + 1] = n + 1;
	for (int i = 1; i <= m + 1; ++i) {
		b[i] = a[i] - a[i - 1] - 1;
		if (b[i] != 0) w = std::min(b[i], w);
	}
	int ans = 0;
	for (int i = 1; i <= m + 1; ++i) {
		ans += (b[i] + w - 1) / w;
	}
	std::cout << ans << "\n";
	return 0;
}
#include<cstdio>
#include<algorithm>
int a[200000];
using namespace std;
int main(void)
{
	long long ans=0,x=0;
	int n,i;
    scanf("%d",&n);
    for(i=0;i<n;i++)	scanf("%d",&a[i]);
    sort(a,a+n);
	for(i=n-1;i>=1;i--){
    	ans+=x;
    	x+=(long long)(a[i]-a[i-1])*(n-i);
    	ans+=(long long)(a[i]-a[i-1])*(n-i);
    }
    printf("%lld\n",ans);
    return 0;
}