//52行目から編集
#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <cassert>

using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<int> > vvi;
typedef vector<vector<ll> > vvl;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;

template<class T> bool chmin(T& a,T b){if(a > b){a = b;return true;}else return false;}
template<class T> bool chmax(T& a,T b){if(a < b){a = b;return true;}else return false;}
///////////////////////////////////////////////////////////

long double add(long double a,long double b){
    if(abs(a+b) < 1e-14 * (abs(a) + abs(b))) return 0;
    else return a + b;
}
constexpr long double EPS = 1e-14;
constexpr long double PI = 3.141592653589793237462;
struct V{
    long double x,y;
    long double add(long double a,long double b){
        if(abs(a+b) < EPS * (abs(a) + abs(b))) return 0;
        else return a + b;
    }
    ///////////////////////////////////////////////////
    V(long double x = 0.0,long double y = 0.0):x(x),y(y){}
    V& operator+=(const V& a){x=add(x,a.x),y=add(y,a.y);return *this;}
    V& operator-=(const V& a){x=add(x,-a.x),y=add(y,-a.y);return *this;}
    V& operator*=(const long double& a){x*=a,y*=a;return *this;}
    V  operator+(const V& b) const{V a(*this);return a+= b;}
    V  operator-(const V& b) const{V a(*this); return a-=b;}
    V  operator*(const long double& b) const{V a(*this); return a*= b;}
    bool  operator<(V& b){return getarg() > b.getarg();}
    long double dot(V b){return add(x * b.x,y * b.y);}
    long double det(V b){return add(x * b.y , -y * b.x);}
    long double norm(){return sqrt(add(x*x , y*y));}
    V  round(long double deg,bool argument = false){//弧度法で入力する時はargument = true
        long double arg = (argument ? deg : PI*(deg/180.0)) ;
        if(argument == true) arg = deg;else arg = PI * (deg / 180.0);
        return V(add(x * cos(arg),-y * sin(arg)),add(x * sin(arg),y * cos(arg)));
    }
    V get_unit(){
        return V(x / norm(),y / norm());
    }
    long double getarg(){
        return atan2(y,x);// [PI,-PI]
    }
    friend ostream& operator<<(ostream& os,V& p){
        os << fixed << setprecision(20);
        os << "(" << p.x << "," << p.y << ")";
        return os;
    }
};
struct GeoUtil{
    long double add(long double a,long double b){
        if(abs(a+b) < EPS * (abs(a) + abs(b))) return 0;
        else return a + b;
    }
    long double dist(V a,V b){
        return sqrt(add(add(b.x,-a.x)*add(b.x,-a.x) , add(b.y,-a.y)*add(b.y,-a.y)));
    }
};
struct C{
    V c;
    long double r;
    C(long double x = 0.0,long double y = 0.0,long double r = 0.0):c(x,y),r(r){}
    pair<V,V> cross(const C& b){
        GeoUtil GU;
        long double r1 = r,r2 = b.r;
        V v_1 = b.c - c;
        long double d = v_1.norm();
        long double x = add(add(r1*r1,-r2*r2),d*d)/(2.0*d);
        long double ratio = x / d;
        V v_2 = v_1 * ratio;
        V p = c + v_2;
        V v_3 = v_2.round(90.0);
        v_3 = v_3.get_unit();
        long double r3 = sqrt(add(r1*r1,-x*x));
        v_3 = v_3 * r3;
        V ans1 = p + v_3;
        V ans2 = p - v_3;
        V check = ans1 - c;
        return make_pair(ans1,ans2);
    }
};
void solve(int n){
    GeoUtil GU;
    vector<C> a(n);
    rep(i,n){
        long double x,y;cin >> x >> y;
        a[i] = C(x,y,1.0);
    }
    int ans = 0;

    for(int i = 0;i < n;i++){
        C P = a[i];
        int cnt = 0;
        for(int j = 0;j < n;j++){
            if(GU.dist(P.c,a[j].c) + EPS < 1.0)cnt++;
        }
        chmax(ans,cnt);
    }
    for(int i = 0;i < n-1;i++){
        for(int j = i+1;j < n;j++){
            if(GU.dist(a[i].c,a[j].c) - EPS > 2.000)continue; 
            V P1 = a[i].cross(a[j]).first;
            V P2 = a[i].cross(a[j]).second;
            int cnt = 0;
            for(int k = 0;k < n;k++){
                if(GU.dist(P1,a[k].c) - EPS < 1.0)cnt++;
            }
            chmax(ans,cnt);
            cnt = 0;
            for(int k = 0;k < n;k++){
                if(GU.dist(P2,a[k].c) - EPS < 1.0)cnt++;
            }
            chmax(ans,cnt);
        }
    }
    cout << ans << '\n';
}
int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    while(1){
        int n;cin >> n;
        if(n)solve(n);
        else break;
    }
    return 0;
}



Measured memory_bytes: 3232