#include <iostream>
#include <complex>
#include <vector>

using namespace std;


class Circle {
public:
	complex<double> p;
	double r;
	Circle (complex<double> p0, double r0) {
		p = p0;
		r = r0;
	}
};

vector<complex<double> > intersectCC(Circle a, Circle b) {
	vector<complex<double> > res(2);

	auto d = abs(a.p - b.p);
	auto c = (d*d + a.r*a.r - b.r*b.r) / (2*d);
	auto s = sqrt(a.r*a.r - c*c);
	auto diff = (b.p - a.p) / d;

	res[0] = a.p + diff * complex<double>(c, s);
	res[1] = a.p + diff * complex<double>(c, -s);

	return res;
}


bool containsCP(Circle c, complex<double> p) {
	const double EPS = 10e-7;
	auto d = abs(c.p - p);
	return d <= c.r + EPS;
}


int main()
{
	int n;

	while (cin >> n, n) {
		vector<complex<double> > ps(n);

		for (int i = 0; i < n; i++) {
			double x[2];
			cin >> x[0] >> x[1];
			ps[i] = complex<double>(x[0], x[1]);
		}

		auto res = 1;

		for (int i = 0; i < n; i++) {
			for (int j = i+1; j < n; j++) {
				if (abs(ps[i]-ps[j]) > 2) continue;
				auto cp = intersectCC(Circle(ps[i], 1.0), Circle(ps[j], 1.0));
				int cnt = 0;
				
				for (int k = 0; k < n; k++) {
					if (containsCP(Circle(cp[0], 1.0), ps[k])) cnt++;
				}

				res = max(cnt, res);
				cnt = 0;

				for (int k = 0; k < n; k++) {
					if (containsCP(Circle(cp[1], 1.0), ps[k])) cnt++;
				}
				res = max(cnt, res);
			}
		}
		cout << res << endl;
	}

	return 0;
}