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

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T, class S> inline bool minup(T& m, S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, S x){ return m<(T)x ? (m=(T)x, true) : false; }

const int    INF = 1000000000;
const ll     MOD = 1000000007LL;
const double EPS = 1E-12;

template<typename T> T add(T x, T y){ if(abs(x+y) < EPS*(abs(x)+abs(y))) return 0; return x + y; }
template<typename T> inline bool semieq(T x, T y){ return abs(x - y) < EPS; }
template<typename T> inline bool semige(T x, T y){ return y - x < -EPS; }
template<typename T> inline bool semile(T x, T y){ return x - y < -EPS; }


struct Point : public complex<double>
{
public:
  Point() { this->real(0);  this->imag(0); }
  Point(const double& x, const double& y) { this->real(x);  this->imag(y); }
  Point(const complex<double> w)  { this->real(w.real());  this->imag(w.imag()); }
  inline double dot(Point p){ return (conj(*this) * p).real(); }  // ??????
  inline double det(Point p){ return (conj(*this) * p).imag(); }  // ??????
};

namespace std
{
  inline bool operator < (const Point& a, const Point& b)
  {
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}
typedef vector<Point> Polygon;
inline Point currPoint(vector<Point> P, int i){ return P[i]; }
inline Point nextPoint(vector<Point> P, int i){ return P[(i+1)%P.size()]; }
inline Point diffPoint(vector<Point> P, int i){ return nextPoint(P, i) - currPoint(P, i); }


struct Circle : Point
{
private:
  Point p;
  double r;

public:
  Circle(Point p, double r) : p(p), r(r) {}
  Circle(double x, double y, double r) : p(Point(x, y)), r(r) {}
  inline Point center(){ return this->p; }
  inline double radius(){ return this->r; }
};

int intersectionDeterminationOfCC(Circle A, Circle B)
{
  double d = abs(A.center() - B.center());
  if(semile(d, A.radius() - B.radius())) return  1;  // B in A
  if(semile(d, B.radius() - A.radius())) return -1;  // A in B
  if(semieq(d, A.radius() - B.radius())) return  2;  // B in A????????\???
  if(semieq(d, B.radius() - A.radius())) return -2;  // A in B????????\???
  if(semige(d, A.radius() + B.radius())) return  3;  // ???????????????
  if(semieq(d, A.radius() + B.radius())) return -3;  // ?????\
  return 4;  // ????????£?????????
}

// ???????????????????¨±??????????????????????????????????????¨????????????????¨???????????????????
vector<Point> intersectionOfCC(Circle A, Circle B)
{
  vector<Point> ret(2);
  double x1 = A.center().real(), y1 = A.center().imag(), r1 = A.radius();
  double x2 = B.center().real(), y2 = B.center().imag(), r2 = B.radius();
  double dx = x2 - x1;
  double dy = y2 - y1;
  double a = dx * dx + dy * dy;
  double b = ((r1 * r1 - r2 * r2) / a + 1) / 2;
  double d = r1 * r1 / a - b * b;
  double x3 = x1 + dx * b;
  double y3 = y1 + dy * b;
  double x4 = -dy * sqrt(d);
  double y4 =  dx * sqrt(d);
  ret[0] = Point(x3 - x4, y3 - y4);
  ret[1] = Point(x3 + x4, y3 + y4);
  return ret;
}

const double r = 1.0;
int N;
double x, y;

int main()
{
  while((cin >> N) && N){
    vector<Point> P;

    rep(i, N){
      cin >> x >> y;
      P.pb(Point(x, y));
    }

    int res = 1;
    rep(i, N) rep(j, i) if(!semige(abs(P[i] - P[j]), 2.0 * r)){
      Circle A = Circle(P[i], r);
      Circle B = Circle(P[j], r);
      vector<Point> PP = intersectionOfCC(A, B);

      vrep(v, PP){
        int cnt = 0;
        vrep(w, P) if(!semige(abs(*w - *v), r)) cnt += 1;
        maxup(res, cnt);
      }
    }
    cout << res << endl;
  }

  return 0;
}

Measured memory_bytes: 1280