#include <iostream>
#include <algorithm>
#include <cmath>
#include <complex>

using namespace std;

typedef complex<double> Point;

const double EPS = 1e-8;

int n;
Point data[300];

int calc(Point a, Point b){
  int res = 0;
  double d = abs(b - a) / 2.0;
  Point ab = (b - a) / (2.0 * d);
  if(d < 1){
    Point o = ab * d;
    d = sqrt(1.0 - d * d);
    o += Point(d * ab.imag() + a.real(), -d * ab.real() + a.imag());
    for(int i=0;i<n;i++){
      if(abs(o - data[i]) < 1.0 + EPS) res++;
    }
  }
  return res;
}

main(){
  while(cin >> n && n){
    for(int i=0;i<n;i++){
      cin >> data[i].imag() >> data[i].real();
    }
    int ans = 1;
    for(int i=0;i<n;i++){
      for(int j=0;j<n;j++){
        ans = max(ans, calc(data[i], data[j]));
        ans = max(ans, calc(data[j], data[i]));
      }
    }
    cout << ans << endl;
  }
}