#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

double pi = 3.14159265358979;

signed main(){
    ios::sync_with_stdio(false);
	cin.tie(0);
    cout << fixed << setprecision(20);

    int n;
    double eps = 1e-6;
    double b = 2*pi/3000;
    while(cin>>n){
        if(n==0) break;
        double x[n],y[n];
        for(int i=0;i<n;i++){
            cin>>x[i]>>y[i];
        }
        int ans = 0;
        for(int i=0;i<n;i++){
            int ret = 0;
            for(int j=0;j<n;j++){
                double d = (x[i] - x[j]) * (x[i] - x[j]);
               d += (y[i] - y[j]) * (y[i]-y[j]);
                if(d <= 1.0) ret++;
            }
            ans = max(ans,ret);
        }
        //cerr << " a " << ans << endl;
        for(int i=0;i<n;i++){
            for(int cnt=0;cnt<3000;cnt++){
                double theta = b*cnt;
                double ox = x[i] + cos(theta);
                double oy = y[i] + sin(theta);
                int ret = 0;
                for(int j=0;j<n;j++){
                    double d = (ox - x[j]) * (ox - x[j]);
                    d += (oy - y[j]) * (oy - y[j]);
                    if(d <= 1.0 + eps) ret++;
                }
                ans = max(ans,ret);
            }
        }
        cout << ans << "\n";
    }
}
