#include<iostream>
#include<cfloat>
#include<cmath>
#include<vector>
#include<algorithm>
#include<stdio.h>
using namespace std;
 
#define EPS (1e-10)
#define equals(a, b) (fabs((a) - (b)) < EPS )
#define dle(a, b) (equals(a, b) || a < b )
#define PI 3.14159265359
#define PI2 6.28318530718
#define INF 99999999.9999

class Point{
public:
  double x, y;
  Point ( double x = 0, double y = 0): x(x), y(y){}
  Point operator + ( Point p ){ return Point(x + p.x, y + p.y); }
  Point operator - ( Point p ){ return Point(x - p.x, y - p.y); }
  Point operator * ( double a ){ return Point(x*a, y*a); }
  Point operator / ( double a ){ return Point(x/a, y/a); }
  double abs() { return sqrt(norm());}
  double norm() { return x*x + y*y; }
  bool operator < ( const Point &p ) const {
    return x != p.x ? x < p.x : y < p.y;
  }
  bool operator == ( const Point &p ) const {
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};

class Segment{
public:
  Point p1, p2;
  Segment ( Point p1 = Point(), Point p2 = Point() ): p1(p1), p2(p2){}
  double abs() { return sqrt(norm());}
  double norm() { return (p2.x - p1.x)*(p2.x - p1.x) + (p2.y - p1.y)*(p2.y - p1.y); }
};

typedef Segment Line;
typedef Point Vector;

double norm( Vector a ){ return a.x*a.x + a.y*a.y; }
double abs( Vector a ){ return sqrt(norm(a)); }
Point polar( double a, double r ){ return Point(cos(r)*a, sin(r)*a);}
double getDistance( Vector a, Vector b ){ return abs(a - b); }
double dot( Vector a, Vector b ){ return a.x*b.x + a.y*b.y; }
double cross( Vector a, Vector b ){ return a.x*b.y - a.y*b.x; }

double getDistanceLP(Line s,Point p){
  return abs(cross(s.p2-s.p1,p-s.p1)/abs(s.p2-s.p1));
}

double R;
int N,ans;
Point p[100];
double r[100],v[100],d[100];
bool die[100];
int main(){
  while(1){
    cin>>R>>N;
    if(R==0&&N==0)break;
    for(int i=0;i<N;i++){
      cin>>p[i].x>>p[i].y>>r[i]>>v[i];
      d[i]=getDistance(p[i],Point());
      die[i]=false;
    }

    while(1){
      //１分進める
      for(int i=0;i<N;i++){
	if(d[i]<EPS+R)continue;
	p[i]=p[i]/d[i];
	d[i]-=v[i];
	p[i]=p[i]*d[i];
      }
      //最も近くにいる敵を探す
      double mini=INF;
      int id=-1;
      for(int i=0;i<N;i++){
	if(die[i]==true)continue;
	if(d[i]<EPS+R)continue;
	if(d[i]>mini)continue;
	mini=d[i];
	id=i;
      }
      if(id==-1)break;
      //レーザー発射の処理
      Segment s = Segment( Point() , p[id] );
      for(int i=0;i<N;i++){
	if( d[i] < EPS+R ) continue;
	if( dot(p[i],p[id]) < 0) continue;
	if( getDistanceLP( s , p[i] ) < EPS+r[i] )die[i]=true;

      }
      
    }
    ans=0;
    for(int i=0;i<N;i++){
      if(die[i]==false)ans++;
    }
    cout<<ans<<endl;
  }
    
  
  return 0;
}