#include <iostream>
#include <vector>
#include <array>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <tuple>
#include <bitset>
#include <memory>
#include <cmath>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cfloat>




struct Point;
struct Circle;
struct Angle;
struct Vector;


Point operator+(const Point& p, const Vector& v);
Point operator+(const Vector& v, const Point& p);
Vector operator-(const Point& to, const Point& from);
Vector operator*(const Vector& v, const double scala);
Vector operator*(const double scala, const Vector& v);
Angle operator+(const Angle& a, const Angle& b);
Angle operator-(const Angle& a, const Angle& b);

struct Point {
	double x, y;
	double distance_from(const Point& p) const;
};
struct Circle {
	Point center;
	double radius;
	bool contains(const Point& p) const;
};
struct Angle {
	double sin, cos;
	static Angle from_cos(const double cos);
	Angle operator-() const;
};
struct Vector {
	double dx, dy;
	Vector rotate(const Angle& angle) const;
	double length() const;
};

int main() {
	while (true) {
		int n; std::cin >> n; if (n == 0) break;
		std::vector<Point> points(n); for (auto& p : points) std::cin >> p.x >> p.y;
		int max_covered_point = 1;
		for (auto i = 1; i < n; ++i) {
			const auto to = points[i];
			for (auto j = 0; j < i; ++j) if (to.distance_from(points[j]) <= 2) {
				const auto from = points[j];
				const auto angle = Angle::from_cos(to.distance_from(from) / 2);
				const auto vec = (to - from) * (1 / from.distance_from(to));
				const auto circle_a = Circle{ from + vec.rotate(angle), 1 };
				const auto circle_b = Circle{ from + vec.rotate(-angle), 1 };
				int count_a = 2, count_b = 2;
				for (auto k = 0; k < n; ++k) if (k != i && k != j) {
					if (circle_a.contains(points[k])) ++count_a;
					if (circle_b.contains(points[k])) ++count_b;
				}
				max_covered_point = std::max({ max_covered_point, count_a, count_b });
			}
		}
		std::cout << max_covered_point << '\n';
	}
}
Vector Vector::rotate(const Angle& angle) const
{
	return Vector{ angle.cos * dx - angle.sin * dy, angle.sin * dx + angle.cos * dy };
}

double Vector::length() const
{
	return std::sqrt(dx * dx + dy * dy);
}

Point operator+(const Point& p, const Vector& v)
{
	return Point{ p.x + v.dx, p.y + v.dy };
}

Point operator+(const Vector& v, const Point& p)
{
	return Point{ p.x + v.dx, p.y + v.dy };
}

Vector operator-(const Point& to, const Point& from)
{
	return Vector{ to.x - from.x, to.y - from.y };
}

Vector operator*(const Vector& v, const double scala)
{
	return Vector{ v.dx * scala, v.dy * scala };
}

Vector operator*(const double scala, const Vector& v)
{
	return Vector{ v.dx * scala, v.dy * scala };
}

Angle operator+(const Angle& a, const Angle& b)
{
	return Angle{ a.sin * b.cos + a.cos * b.sin, a.cos * b.cos - a.sin * b.sin };
}

Angle operator-(const Angle& a, const Angle& b)
{
	return Angle{ a.sin * b.cos - a.cos * b.sin, a.cos * b.cos + a.sin * b.sin };
}

double Point::distance_from(const Point& p) const
{
	return (*this - p).length();
}

bool Circle::contains(const Point& p) const
{
	return center.distance_from(p) <= radius;
}

Angle Angle::from_cos(const double cos)
{
	return Angle{ std::sqrt(1 - cos * cos), cos };
}

Angle Angle::operator-() const
{
	return Angle{ -sin, cos };
}



Measured memory_bytes: 3232