#include<iostream>
#include<iomanip>
#include<vector>
#include<cmath>
using namespace std;

const double EPS = 1e-4;

#define x first
#define y second

void normalize(double &a, double &b){
    double norm = sqrt(a*a + b*b);
    a /= norm;
    b /= norm;
}

int main(){
    int n;
    while(cin >> n, n){
        int ans = 1;
        vector<pair<double,double>> v;
        for(int i = 0; i < n; i++){
            double a, b;
            cin >> a >> b;
            v.push_back({a,b});
        }
        for(int i = 0; i < n; i++){
            for(int j = i+1; j < n; j++){
                double dx = v[i].x-v[j].x, dy = v[i].y-v[j].y;
                if(sqrt(dx*dx+dy*dy) > 2.0000)    continue;
                double midx = (v[i].x+v[j].x)/2, midy = (v[i].y+v[j].y)/2;
                double ux = 0, uy = 0, cx, cy;
                if(dx == 0)         ux = 1;
                else if(dy == 0)    uy = 1;
                else                ux = 1, uy = -dx/dy;
                normalize(ux, uy);
                double scale = sqrt(1*1 - (v[i].x-midx)*(v[i].x-midx) - (v[i].y-midy)*(v[i].y-midy));
                for(int k = -1; k <= 1; k++){
                    if(k == 0)  continue;
                    cx = midx + scale * ux * k;
                    cy = midy + scale * uy * k;
                    int tmp = 0;
                    for(int l = 0; l < n; l++){
                        if((v[l].x-cx)*(v[l].x-cx)+(v[l].y-cy)*(v[l].y-cy) <= 1+EPS)    tmp++;
                    }
                    ans = max(ans, tmp);
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}
