#include <cstdio>
#include <algorithm>
using namespace std;
int a[1011];
int main()
{
    int r, n;
    while (scanf("%d%d", &r, &n), ~(r & n))
    {
        for (int i = 0; i < n; i++)
            scanf("%d", a + i);
        sort(a, a + n);
        int i = 0, res = 0;
        while (i < n)
        {
            int s = a[i++];
            while (i < n && a[i] - r <= s) i++;
            int p = a[i - 1];
            while (i < n && a[i] <= p + r) i++;
            res++;
        }
        printf("%d\n", res);
    }
    return 0;
}