#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
typedef complex<double> P;  // Point
static const double EPS = 1e-6;

int main() {
	int N;
	while (cin >> N, N) {
		vector<P> points;
		priority_queue<tuple<int, double, double, double>, vector<tuple<int, double, double, double>>> pq;
		rep(n, N) {
			double x, y;
			cin >> x >> y;
			points.push_back(P(x, y));
		}
		tuple<int, double, double, double> s = make_tuple(N, -5.0, 5.0, 5.0);
		pq.push(s);
		while(!pq.empty()) {
			s = pq.top();
			//cout << get<1>(s)<< " " <<get<0>(s) << endl;
			if (-get<1>(s) < EPS) break;
			pq.pop();
			double r = -get<1>(s) / 2;
			rep(i, 2) {
				rep(j, 2) {
					double x1 = get<2>(s) - get<1>(s) / 2 + i * get<1>(s);
					double y1 = get<3>(s) - get<1>(s) / 2 + j * get<1>(s);
					int cnt = 0;
					P p1 = P(x1, y1);
					for(auto p2 : points) {
						if (abs(p1 - p2) < r * sqrt(2) + 1 + EPS) cnt++;
					}
					pq.push(make_tuple(cnt, -r, x1, y1));
				}
			}
		}
		cout << get<0>(s) << endl;
	}
}
