import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.container;
import std.datetime;


class Circle {
	cdouble p;
	double r;
	this (cdouble p, double r) {
		this.p = p;
		this.r = r;
	}
}

double complexabs(cdouble a) {
	return hypot(a.re, a.im);
}


cdouble[] intersectCC(Circle a, Circle b) {
	cdouble[] res;

	auto d = complexabs(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 ~= a.p + diff * (c + s * 1i);
	res ~= a.p + diff * (c - s * 1i);

	return res;
}


bool containsCP(Circle c, cdouble p) {
	immutable EPS = 10e-7;
	auto d = complexabs(c.p - p);
	return d <= c.r + EPS;
}


void main()
{
	int n;

	while (n = readln.chomp.to!int, n) {
		auto ps = new cdouble[](n);
		foreach (i; 0..n) {
			auto x = readln.chomp.split.map!(to!double);
			ps[i] = x[0] + x[1] * 1i;
		}

		auto res = 1;

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

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

				foreach (k; 0..n) {
					if (containsCP(new Circle(cp[1], 1.0), ps[k])) cnt++;
				}
				res = max(cnt, res);
			}
		}
		res.writeln;
	}
}