#include <iostream>
#include <cmath>

using namespace std;

struct UFO {
	double x, y, r, v, dist2;
	bool flag;
} ufo[100];

int main() {
	int N, R;

	while (cin >> R >> N, R || N) {
		for (int i = 0; i < N; ++i) {
			cin >> ufo[i].x >> ufo[i].y >> ufo[i].r >> ufo[i].v;
			ufo[i].flag = true;
			ufo[i].dist2 = ufo[i].x*ufo[i].x + ufo[i].y*ufo[i].y;
		}

		while (1) {
			int ans = 0;
			bool flag = true;
			for (int i = 0; i < N; ++i) {
				if (!ufo[i].flag) continue;
				if (ufo[i].dist2 <= R*R)
					++ans;
				else {
					flag = false;
					break;
				}
			}
			if (flag) {
				cout << ans << endl;
				break;
			}

			for (int i = 0; i < N; ++i) {
				if (!ufo[i].flag) continue;

				if (ufo[i].x == 0.0) {
					if (ufo[i].y > 0.0) {
						ufo[i].y -= ufo[i].v;
					}
					if (ufo[i].y < 0.0) {
						ufo[i].y += ufo[i].v;
					}
				}
				else {
					double tmp = atan2(ufo[i].y, ufo[i].x);
					ufo[i].x -= ufo[i].v * cos( tmp );
					if (ufo[i].y != 0.0)
						ufo[i].y -= ufo[i].v * sin( tmp );
				}

				ufo[i].dist2 = ufo[i].x*ufo[i].x + ufo[i].y*ufo[i].y;
			}

			int target = -1;
			for (int i = 0; i < N; ++i) {
				if (!ufo[i].flag || ufo[i].dist2 <= R*R) continue;

				if (target < 0) {
					target = i;
				}
				else if (ufo[i].dist2 < ufo[target].dist2) {
					target = i;
				}
			}
			ufo[target].flag = false;
			for (int i = 0; i < N; ++i) {
				if (!ufo[target].flag) continue;
				double targetdist2;
				if (ufo[target].x == 0.0)
					targetdist2 = ufo[i].x*ufo[i].x;
				else
					targetdist2 = (-ufo[target].y*ufo[i].x + ufo[target].x*ufo[i].y)*(-ufo[target].y*ufo[i].x + ufo[target].x*ufo[i].y) / ufo[target].dist2;
				
				if (targetdist2 <= ufo[i].r*ufo[i].r)
					ufo[i].flag = false;
			}
		}
	}

	return 0;
}