#define M_PI 3.14159265359
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;
class P{
public:
	double x,y;
	P(){}
	P(double xx,double yy){
		x=xx;
		y=yy;
	}
	P operator +(P p){
		return P(x+p.x,y+p.y);
	}
	P operator -(P p){
		return P(x-p.x,y-p.y);
	}
	P operator /(double d){
		return P(x/d,y/d);
	}
};

int n;
P p[301];

int main(void){
	while(1){
		scanf("%d",&n);
		if(n==0)break;
		for(int i=0;i<n;i++){
			scanf("%lf%lf",&p[i].x,&p[i].y);
		}
		int res=1;
		for(int i=0;i<n;i++){
			for(int j=i+1;j<n;j++){
				P np=p[j]-p[i];
				//printf("%lf %lf\n",np.x,np.y);
				double blen=np.x*np.x/4.0+np.y*np.y/4.0;
				if(blen>1.0)continue;
				double len=sqrt(1-blen);
				double dir=atan2(np.y,np.x);
				P cp=(p[i]+p[j])/2+P(len*cos(dir+M_PI/2),len*sin(dir+M_PI/2));
				int cnt=0;
				for(int k=0;k<n;k++){
					double len2=sqrt((cp.x-p[k].x)*(cp.x-p[k].x)+(cp.y-p[k].y)*(cp.y-p[k].y));
					if(len2<=1.0001)cnt++;
				}
				res=max(res,cnt);
				cp=(p[i]+p[j])/2+P(len*cos(dir-M_PI/2),len*sin(dir-M_PI/2));
				cnt=0;
				for(int k=0;k<n;k++){
					double len2=sqrt((cp.x-p[k].x)*(cp.x-p[k].x)+(cp.y-p[k].y)*(cp.y-p[k].y));
					if(len2<=1.0001)cnt++;
				}
				res=max(res,cnt);
			}
		}
		printf("%d\n",res);
	}
	return 0;
}