//#include <bits/stdc++.h>
#include <fstream>
#include <algorithm>
#include <iostream>
using namespace std;
int n,m,gtln,d;
int a[100000];
void Read_Int(int &x)
{
    char c;
    bool neg=false;
    for (c=getchar();c!='-'&&(c<'0'||c>'9');c=getchar());
    if (c=='-') {neg=true;c=getchar();}
    x= c-'0';
    for (c=getchar();c>='0'&&c<='9';c=getchar())
    {
        x=x*10+c-'0';
    }
    if (neg==true) x=(-1)*x;
}
void Write_Int(int x)
{
    if (x<0) {putchar('-');Write_Int((-1)*x);}
    if (x>9) Write_Int(x/10);
    putchar(x%10+'0');
}
#define swap(type, a, b) {type temp = a; a = b; b = temp; } // hang hoan vi

void quickSort(int *a, int l, int r)
{
    srand(time(NULL));  //khoi tao tham so ham rand()
    int key = a[l + rand() % (r-l+1)];  //lay khoa la gia tri ngau nhien tu a[l] -> a[r]
    //int key = a[(l+r)/2];
    int i = l, j = r;

    while(i <= j)
    {
        while(abs(a[i]) < abs(key)) i++;       // tim phan tu ben trai ma >=key
        while(abs(a[j]) > abs(key)) j--;       // tim phan tu ben trai ma <=key
        if(i <= j)
        {
            if (i < j)
                swap(int, a[i], a[j]);  // doi cho 2 phan tu kieu int a[i], a[j].
            i++;
            j--;
        }
    }
    //bay gio ta co 1 mang : a[l]....a[j]..a[i]...a[r]
    if (l < j) quickSort(a, l, j);   // lam lai voi mang a[l]....a[j]
    if (i < r) quickSort(a, i, r); // lam lai voi mang a[i]....a[r]
}
int main()
{
	freopen("EXPLORE.inp","r",stdin);
	freopen("EXPLORE.out","w",stdout);
	//ios_base::sync_with_stdio(false);
    //Read_Int(m);
    //Read_Int(n);
    cin>>m>>n;
    for (int i=0;i<n;i++) cin>>a[i];//Read_Int(a[i]);
    a[n]=0;
    n++;
    quickSort(a,0,n);
    for (int i=1;i<n;i++)
    {
        int c=abs(a[i]-a[i-1]);
        if (m>c)
        {m=m-c;
        d++;}
        else break;
    }
    //putchar(10);
    //Write_Int(d-1);
    cout<<d-1;
}

