#include<iostream>
#include<vector>
#include<complex>
#define EPS 1.0e-10
using namespace std;
typedef double elem;
typedef complex<elem> point,vec;
inline elem dist(const point &a, const point &b){return abs(a-b);}
inline vec normr(const vec &v){return v*vec(0,-1);}
inline vec norml(const vec &v){return v*vec(0,1);}
inline vec unormr(const vec &v){return normr(v) / abs(v);}
inline vec unorml(const vec &v){return norml(v) / abs(v);}
int main(){
	while(true){
		int ans = 1;
		int n;
		scanf("%d", &n);
		if(n==0)break;
		vector< point > points;
		for(int i=0;i<n;++i){
			elem x, y;
			scanf("%lf%lf", &x, &y);
			points.push_back( point(x,y) );
		}
		for(unsigned int i = 0; i < points.size(); ++i){
			for(unsigned int j = i + 1; j < points.size(); ++j){
				if( dist( points[i], points[j] ) <= 2 ){
					int count_p = 0;
					int count_q = 0;
					elem d = (elem)sqrt( 1.0 - pow( dist(points[i], points[j]) / 2.0, 2.0 ) );
					point p,q;
					vec ab = points[j] - points[i];
					point t = 0.5 * ab + points[i];  
					p = d * unormr(ab) + t;
					q = d * unorml(ab) + t;
					//cout << i << "," << j << endl;
					for(unsigned int k = 0; k < points.size(); ++k){
						//cout << dist(p,points[k]) << " " << dist(q,points[k]) << endl;

						if( dist(p, points[k]) <= 1+EPS ){ count_p++; }
						if( dist(q, points[k]) <= 1+EPS ){ count_q++; }
					}
					ans = max(ans, max(count_q, count_p) );
				}
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}