#include<deque>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<cmath>
#include<cstdio>
#include<cstring>
using namespace std;
#define dis(p,q) ((p)*(p)+(q)*(q))
int main(){
  int i,j,k;
  int n;
  while(cin>>n,n){
    double x[300],y[300];
    for(i=0;i<n;++i)
      cin>>x[i]>>y[i];    
    int mx=1;
    for(i=0;i<n-1;++i){
      for(j=i+1;j<n;++j){
	double d=dis(x[i]-x[j],y[i]-y[j]);
	if(d<=4){
	  double cx,cy,a=atan2(y[i]-y[j],x[i]-x[j]);
	  int sm;
	  cx=(x[i]+x[j])/2+cos(a+M_PI/2)*sqrt(1-d/4);
	  cy=(y[i]+y[j])/2+sin(a+M_PI/2)*sqrt(1-d/4);
	  sm=2;
	  for(k=0;k<n;++k){
	    if(k!=i&&k!=j&&dis(x[k]-cx,y[k]-cy)<=1)
	      ++sm;
	  }
	  mx=max(mx,sm);
	  cx=(x[i]+x[j])/2+cos(a-M_PI/2)*sqrt(1-d/4);
	  cy=(y[i]+y[j])/2+sin(a-M_PI/2)*sqrt(1-d/4);
	  sm=2;
	  for(k=0;k<n;++k){
	    if(k!=i&&k!=j&&dis(x[k]-cx,y[k]-cy)<=1)
	      ++sm;
	  }
	  mx=max(mx,sm);
	}
      }
    }
    cout<<mx<<endl;
  }
  return 0;
}