#include #include #include #include #include #include #define ll long long #define P pair #define lP pait using namespace std; int main() { ll h,n; ll ans=0; cin>>h>>n; vector a(n); for(int i=0;i>a[i]; } a[n-1]=h; sort(a.begin(),a.end(),greater<>()); for(int i=0;i