#include <bits/stdc++.h>
using namespace std;
typedef complex<double> pt;
#define rep(i,n) for(int i=0;i<n;i++)
int n;
pt z[305];
int check(pt C){
	int ret = 0;
	rep(i,n){
		if(abs(z[i]-C) <= 1.0+1e-12) ret++;
	}
	assert(ret>=2);
	return ret;
}
int main(){
	while(1){
		scanf("%d",&n);
		if(n == 0) return 0;
		rep(i,n){
			double x,y; scanf("%lf%lf",&x,&y);
			z[i] = pt(x,y);
		}
		int ans = 1;
		rep(i,n) for(int j=i+1;j<n;j++){
			if(abs(z[i]-z[j]) > 2.0+1e-12) continue;
			pt mid = (z[i]+z[j])/2.0;
			double leng = sqrt(1.0-abs(z[i]-z[j])*abs(z[i]-z[j])/4.0);
			pt c1 = mid + (z[i]-z[j])/abs(z[i]-z[j]) * polar(leng,3.141592653589/2.0);
			pt c2 = mid - (z[i]-z[j])/abs(z[i]-z[j]) * polar(leng,3.141592653589/2.0);
			ans = max(ans,check(c1));
			ans = max(ans,check(c2));
		}
		printf("%d\n",ans);
	}
}
