#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <complex>

using namespace std;
typedef complex<double> P;

int N;
P dots[300];
#define EPS (1e-6)

// 2_ðÊé¼arÌ~Ì_ðßé
pair<P,P> calcCircleCenterPoint(P dot1,P dot2,double r){
    double v=abs(dot1-dot2);
    double x = sqrt(r*r - (v/2)*(v/2));
    // ñgÌPÊ@üxNg
    P hose[2];
    //double y1 = -(1.0)/(dot1.imag() - dot2.imag());
    //double x1 = 1.0/(dot1.real() - dot2.real());
    double x1=-(dot1.imag()-dot2.imag());
    double y1=(dot1.real() - dot2.real());
    hose[0]=P(x1,y1);
    //double y2 = 1.0/(dot1.imag() - dot2.imag());
    //double x2 = -1.0/(dot1.real() - dot2.real());
    double y2=-y1;
    double x2=-x1;
    hose[1]=P(x2,y2);
    double dd1=abs(hose[0]);
    double dd2=abs(hose[1]);
    hose[0]/=dd1;hose[0]*=x;
    hose[1]/=dd2;hose[1]*=x;
    P tmp=(dot1+dot2);
    tmp/=2;
    hose[0]+=tmp;
    hose[1]+=tmp;
    return make_pair(hose[0],hose[1]);
}

int main(){

	while(cin >> N && N != 0){
        for(int i = 0; i < N; i++){
            P p;
            double x,y;
            cin>>x>>y;
            dots[i]=P(x,y);
            //cin >> dots[i].second >> dots[i].first;
		}
		int maxCnt = 1;
		// ~ðìé½ßÌQ_ðßé
		for(int i = 0; i < N; i++){
			for(int j = i+1; j < N; j++){
                //pair<double,double> dot1,dot2;
                P dot1,dot2;
				dot1 = dots[i];
				dot2 = dots[j];
                //double v = sqrt((dot1.first - dot2.first)*(dot1.first - dot2.first)
                //+(dot1.second - dot2.second)*(dot1.second - dot2.second));
                double v=abs(dot1-dot2);
				// ñ_Ô£ª2æè¨¨«¯êÎÂ­êÈ¢
				if(v > 2.0 + EPS){
					continue;
				}

    //            double x = sqrt(1 - (v/2)*(v/2));
				//// ñgÌPÊ@üxNg
                P hose[2];
                pair<P,P> tmp=calcCircleCenterPoint(dot1,dot2,1);
                hose[0]=tmp.first;
                hose[1]=tmp.second;
    //            double y1 = -1.0/(dots[i].imag() - dots[j].imag());
    //            double x1 = 1.0/(dots[i].real() - dots[j].real());
    //            hose[0]=P(x1,y1);
    //            double y2 = 1.0/(dots[i].imag() - dots[j].imag());
    //            double x2 = -1.0/(dots[i].real() - dots[j].real());
    //            hose[1]=P(x2,y2);

				////double dd1 = sqrt((hose[0].second)*(hose[0].second)+(hose[0].first)*(hose[0].first));
    //            //double dd2 = sqrt((hose[1].second)*(hose[1].second)+(hose[1].first)*(hose[1].first));
    //            double dd1=abs(hose[0]);
    //            double dd2=abs(hose[1]);
    //            hose[0]/=dd1;hose[0]*=x;
    //            hose[1]/=dd2;hose[1]*=x;
    //            P tmp=(dot1+dot2);
    //            tmp/=2;
    //            hose[0]+=tmp;
    //            hose[1]+=tmp;

    //            hose[0].first /= dd1; hose[0].second /= dd1;
				//hose[1].first /= dd2; hose[1].second /= dd2;
				// x{·é
				//hose[0].first *= x;hose[1].first *= x;
				//hose[0].second *= x;hose[1].second *= x;

				// mð«·
				//hose[0].first += (dot1.first + dot2.first)/2;
				//hose[0].second += (dot1.second + dot2.second)/2;
				//hose[1].first += (dot1.first + dot2.first)/2;
				//hose[1].second += (dot1.second + dot2.second)/2;

				// hose[0]Æhose[1]Í~ÌSÀW
				// e_ÉÖµÄ~ÌÉ¶Ý·é©Ç¤©ðßé
				for(int k = 0; k < 2; k++){
                    int cnt = 0;
					for(int l = 0; l < N; l++){
						//double dist = sqrt((dots[l].first -hose[k].first)*(dots[l].first -hose[k].first)
						//	+ (dots[l].second -hose[k].second)*(dots[l].second -hose[k].second));
                        double dist=abs(dots[l]-hose[k]);
						if(dist <= 1.0 + EPS){
							cnt++;
						}
					}
					maxCnt = max(maxCnt,cnt);
				}
			}
		}
		cout << maxCnt << endl;
	}

	return 0;
}

Measured memory_bytes: 0