// Slower C++ solution:
#include <stdio.h>

#include <string.h>

#include <algorithm>

#include <iostream>

#include <math.h>

#include <assert.h>

#include <vector>

#include <complex>

#include <queue>



using namespace std;

typedef long long ll;

typedef complex<double> Point;

static const double EPS = 1e-9;

static const double PI = acos(-1.0);



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

#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)

#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)

#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)

#define DEC(i, s) for (int i = (s); i >= 0; i--)



#define SIZE(v) (int)((v).size())

#define MEMSET(v, h) memset((v), h, sizeof(v))

#define FIND(m, w) ((m).find(w) != (m).end())



int n;

double R;

Point points[3000];



struct Node {

  Point p;

  double w;

  int bound;

  Node(Point p, double w, int bound) : p(p), w(w), bound(bound) {;}

  bool operator<(const Node &rhs) const {

    return bound < rhs.bound;

  }

};



int main() {

  R = 1.0;

  while (scanf("%d", &n), n) {

    priority_queue<Node> que;

    REP(i, n) {

      double x, y;

      scanf("%lf %lf", &x, &y);

      points[i] = Point(x, y);

      que.push(Node(points[i], R, 10000));

    }

    int ans = 1;

    while (!que.empty()) {

      Node node = que.top();

      que.pop();

      if (node.bound <= ans) { break; }

      int lans = 0;

      int nbound = 0;

      REP(i, n) {

        double dist = abs(points[i] - node.p);

        if (dist < R) {

          lans++;

          nbound++;

        } else if (dist < R + node.w * 1.41421356) {

          nbound++;

        }

      }

      ans = max(ans, lans);

      if (nbound <= ans) { continue; }

      const double dx[4] = { -1, -1, 1, 1 };

      const double dy[4] = { -1, 1, -1, 1 };

      double nw = node.w / 2.0;

      REP(i, 4) {

        double nx = node.p.real() + nw * dx[i];

        double ny = node.p.imag() + nw * dy[i];

        que.push(Node(Point(nx, ny), nw, nbound));

      }

    }

    printf("%d\n", ans);

  }

}

// Faster C++ solution for the same problem (measured speedup: 1.374764039069715x):
#include <stdio.h>

#include <string.h>

#include <algorithm>

#include <iostream>

#include <math.h>

#include <assert.h>

#include <vector>



using namespace std;

typedef long long ll;

typedef unsigned int uint;

typedef unsigned long long ull;

static const double EPS = 1e-9;

static const double PI = acos(-1.0);



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

#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)

#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)

#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)

#define MEMSET(v, h) memset((v), h, sizeof(v))



#include <complex>

typedef complex<double> Point;

// O(n^2logn)

int MaxPointCircle(const vector<Point> points, double r) {

  const int n = points.size();

  int ret = 1;

  for (int i = 0; i < n; i++) {

    vector<pair<double, int> > radians;

    for (int j = 0; j < n; j++) {

      double d = abs(points[i] - points[j]) / 2.0;

      if (i == j || d * 2.0 - r * 2.0 > EPS) { continue; }

      Point center = (points[i] + points[j]) / 2.0;

      Point vect = (points[j] - points[i]) * Point(0, -1);

      vect /= abs(vect);

      double l = sqrt(r * r - d * d);

      Point c1 = center + vect * l;

      Point c2 = center - vect * l;

      double arg1 = arg(c1 - points[i]) - EPS;

      double arg2 = arg(c2 - points[i]) + EPS;

      radians.push_back(make_pair(arg1, (j + 1)));

      radians.push_back(make_pair(arg2, -(j + 1)));

    }

    if ((int)radians.size() / 2 < ret - 1) { continue; }

    sort(radians.begin(), radians.end());

    vector<bool> used(points.size(), false);

    int lsum = 1;

    REP(iter, 2) {

      REP(j, radians.size()) {

        int index = abs(radians[j].second) - 1;

        bool start = radians[j].second > 0 ? true : false;

        if (used[index] && !start) {

          used[index] = false;

          lsum--;

        } else if (!used[index] && start) {

          used[index] = true;

          lsum++;

        }

        ret = max(ret, lsum);

      }

    }

  }

  return ret;

}



int main() {

  int n;

  while (scanf("%d", &n), n) {

    vector<Point> points(n);

    REP(i, n) {

      double x, y;

      scanf("%lf %lf", &x, &y);

      points[i] = Point(x, y);

    }

    printf("%d\n", MaxPointCircle(points, 1.0));

  }

}