#include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <cmath>
using namespace std;

const double eps = 1e-7;
int xs[100], ys[100], rs[100], vs[100];
bool shoot[100];

inline int sq(int x) { return x*x; }
inline double sq(double x) { return x*x; }

int main() {
	int R, N;
	while (cin >> R >> N, (R || N)) {
		for (int i=0; i<N; ++i) {
			cin >> xs[i] >> ys[i] >> rs[i] >> vs[i];
		}
		memset(shoot, false, sizeof shoot);
		for (int m=1; ; ++m) {
			int k = -1, minDist = INT_MAX;
			for (int i=0; i<N; ++i) {
				int dist = sq(xs[i])+sq(ys[i]) - sq(R+vs[i]*m);
				if ( ! shoot[i] && 0 < dist && dist < minDist) {
					minDist = dist;
					k = i;
				}
			}
			if (k == -1) break;
			shoot[k] = true;
			for (int i=0; i<N; ++i) {
				int dist = sq(xs[i])+sq(ys[i]) - sq(R+vs[i]*m);
				if ( ! shoot[i] && 0 < dist) {
					double x = xs[k] - vs[k] * cos(atan2(ys[k], xs[k]));
					double y = ys[k] - vs[k] * sin(atan2(ys[k], xs[k]));
					double p = xs[i] - vs[i] * cos(atan2(ys[i], xs[i]));
					double q = ys[i] - vs[i] * sin(atan2(ys[i], xs[i]));
					double a = y/x;
					double t = sq(a*p-q)/(1+a*a);
					if (t <= sq(rs[i]) + eps) {
						shoot[i] = true;
					}
				}
			}
		}
		int res = 0;
		for (int i=0; i<N; ++i) {
			if ( ! shoot[i]) ++res;
		}
		cout << res << endl;
	}
	return 0;
}