#include <iostream>
#include <complex>
#include <vector>

using namespace std;

#define reep(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) reep((i),0,(n))

#define EPS 1e-8

typedef complex<double> P;

double dot(P a,P b){
	return real(a)*real(b)+imag(a)*imag(b);
}

double cross(P a,P b){
	return real(a)*imag(b)-imag(a)*real(b);
}

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

int main(){
	int n;
	while(cin>>n,n){
		vector<P> v(n);
		rep(i,n){
			double a,b;
			cin>>a>>b;
			v[i]=P(a,b);
		}
		int ans = 1;
		rep(i,n){
			rep(j,i){
				// cout<<i<<" "<<j<<" "<<abs(v[j]-v[i])<<endl;
				if(abs(v[j]-v[i])-2>EPS) continue;
				P c = v[j]-v[i];
				P n1 = (c*P(0,+1))/abs(c);
				P n2 = (c*P(0,-1))/abs(c);
				double d = sqrt(1-sq(abs(v[j]-v[i])/2));
				// cout<<"d "<<d<<endl;
				n1*=d;
				n2*=d;
				n1 += (v[j]-v[i])/2.0;
				n2 += (v[j]-v[i])/2.0;
				// cout<<"n1 "<<n1.real()<<" "<<n1.imag()<<endl;
				int tmp1=0;
				int tmp2=0;
				rep(k,n){
					if(1-abs(n1-v[k]+v[i])>-EPS) tmp1++;
					if(1-abs(n2-v[k]+v[i])>-EPS) tmp2++;
				}
				ans=max(ans,tmp1);
				ans=max(ans,tmp2);
			}
		}
		cout<<ans<<endl;
		// break;
	}
}