#include <bits/stdc++.h>
using namespace std;
int ans = 0;
struct Rect {
  double x, y, size;
  int count;
  Rect(double x = 0, double y = 0, double size = 0, int count = 0)
      : x(x), y(y), size(size), count(count) {}
};
bool operator<(const Rect &a, const Rect &b) { return a.count < b.count; }
struct Point {
  double x, y;
  Point(double x = 0, double y = 0) : x(x), y(y) {}
};
priority_queue<Rect> que;
int N;
vector<Point> point;
const double EPS = 1e-8;
void makerect(double x, double y, double size) {
  int cnt = 0, cnt2 = 0;
  x += size * .5;
  y += size * .5;
  for (int i = 0; i < (int)(N); i++) {
    if (((point[i].x - x) * (point[i].x - x)) +
            ((point[i].y - y) * (point[i].y - y)) <=
        ((0.70711 * size + 1 + EPS) * (0.70711 * size + 1 + EPS)))
      cnt++;
    if (((point[i].x - x) * (point[i].x - x)) +
            ((point[i].y - y) * (point[i].y - y)) <=
        1.00 + EPS)
      cnt2++;
  }
  x -= size * .5;
  y -= size * .5;
  ans = max(ans, cnt2);
  if (cnt > ans) que.push(Rect(x, y, size, cnt));
}
void solve() {
  que = priority_queue<Rect>();
  que.push(Rect(0, 0, 10.0, N));
  while (!que.empty()) {
    Rect t = que.top();
    que.pop();
    if (t.count <= ans) {
      break;
    }
    (makerect(t.x, t.y, t.size * .5));
    (makerect(t.x + t.size * .5, t.y, t.size * .5));
    (makerect(t.x, t.y + t.size * .5, t.size * .5));
    (makerect(t.x + t.size * .5, t.y + t.size * .5, t.size * .5));
  }
}
int main() {
  for (; cin >> N, N;) {
    point = vector<Point>(N);
    for (int i = 0; i < (int)(N); i++) {
      cin >> point[i].x >> point[i].y;
    }
    ans = 1;
    solve();
    cout << ans << endl;
  }
}
