vartot,n,ans:longint;a,b:array[0..2000] of longint;
procedureqsort(l,r:longint);vari,j,x,t:longint;
beginif l>=r thenexit;i:=l;j:=r;x:=a[l+random(r-l)];repeatwhile a[i]>x do inc(i);while a[j]<x do dec(j);if i<=j thenbegint:=a[i];a[i]:=a[j];a[j]:=t;inc(i);dec(j);end;until i>j;qsort(l,j);qsort(i,r);
end;
procedureinit;vari,min,max:longint;
beginreadln(tot,n,n);min:=maxlongint;max:=0;for i:=1to n dobeginreadln(a[i]);if a[i]<min then min:=a[i];if a[i]>max then max:=a[i];end;ans:=max-min;
end;
proceduremain;vari:longint;
beginfor i:=2to n do b[i]:=abs(a[i]-a[i-1]);a:=b;qsort(2,n);if tot>=n then tot:=n;for i:=2to2+tot-2do dec(ans,a[i]);writeln(ans+tot);
end;
beginrandomize;init;qsort(1,n);main;
end.