#include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

using namespace std;
pair<double,double> smul(pair<double,double> a,double k){
  return make_pair(a.first*k,a.second*k);
}
pair<double,double> sub2(pair<double,double> a,pair<double,double> b){
  return make_pair(a.first-b.first,a.second-b.second);
}
pair<double,double> mean2(pair<double,double> a,pair<double,double> b){
  return make_pair((a.first+b.first)/2,(a.second+b.second)/2);
}
double dist(pair<double,double> a,pair<double,double> b){
  return sqrt(pow(a.first-b.first,2)+pow(a.second-b.second,2));
}
int main(void)
{
  for(;;){
    int n;
    cin >> n;
    if(!n) return 0;
    vector<pair<double,double> > ps;
    ps.resize(n);
    REP(i,n) cin >> ps[i].first >> ps[i].second;
    vector<pair<double,double> > co;
    co.clear();
    REP(j,n) REP(i,j){
      if(dist(ps[i],ps[j])>2) continue;
      pair<double,double> m=mean2(ps[i],ps[j]);
      double k=sqrt(1-pow(dist(ps[i],ps[j])/2.0,2.0));
      pair<double,double> tmp=sub2(ps[i],ps[j]);
      tmp=smul(make_pair(tmp.second,-tmp.first),k/dist(ps[i],ps[j]));
      co.push_back(sub2(m,tmp));
      tmp=smul(tmp,-1.0);
      co.push_back(sub2(m,tmp));
    }
    int answer=1;
    for(auto x:co){
      int tmpans=0;
      REP(i,n) if(dist(x,ps[i])<1.000001) ++tmpans;
      answer=max(answer,tmpans);
    }
    cout << answer << endl;

  }
}