#include <bits/stdc++.h>
using namespace std;
typedef complex<double> Point;
#define X real()
#define Y imag()
#define LE(n,m) ((n)<(m)+EPS)
#define GE(n,m) ((n)+EPS>(m))
#define EQ(n,m) (abs((n)-(m))<EPS)
const double EPS=1e-8;

//center of circle going through two given points of which radius equals to r
vector<Point> centergivenradius(const Point &a,const Point &b,const double &r){
    vector<Point> cs;
    Point ls=(b-a)*0.5;
    double dist=abs(ls);
    if (dist==0.0||dist>r) return cs;
    double len=sqrt(r*r-dist*dist);
    Point n=ls*Point(0.0,1.0)*(len/dist);
    cs.emplace_back(a+ls+n);
    if (GE(len,0.0)) cs.emplace_back(a+ls-n);
    return cs;
}

void solve(int N){
    vector<Point> P;
    for (int i=0;i<N;++i){
        double x,y; cin >> x >> y;
        P.emplace_back(x,y);
    }
    int ans=1;
    for (int i=0;i<N;++i){
        for (int j=i+1;j<N;++j){
            double dist=norm(P[i]-P[j]);
            if (GE(dist,4.0)) continue;
            vector<Point> center=centergivenradius(P[i],P[j],1.0);
            for (int l=0;l<2;++l){
                int cnt=2;
                for (int k=0;k<N;++k){
                    if (k==i||k==j) continue;
                    cnt+=(LE(norm(P[k]-center[l]),1.0));
                }
                ans=max(ans,cnt);
            }
        }
    }
    cout << ans << '\n';
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    while(cin >> N,N){
        solve(N);
    }
}
