////////////////////
///   template   ///
////////////////////
#include <cassert>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <vector>
#include <queue>
#include <string>
#include <complex>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
using namespace std;

//// MACRO ////
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i,n) for (int i = (n)-1; i >= 0; i--)
#define FOR(i,s,n) for (int i = (s); i < (n); i++)
#define allof(c) c.begin(), c.end()
#define partof(c,i,n) c.begin() + (i), c.begin() + (i) + (n)
#define EPS 1e-10
#define INF 1000000000

#define countof(a) (sizeof(a)/sizeof(a[0]))
#define PREDIACTE(t,a) [](const t & a) -> bool
#define COMPARISON_T(t) bool(*)(const t &, const t &)
#define COMPARISON(t,a,b) [](const t & a, const t & b) -> bool

//// prime ////
vector<unsigned char> isPrime;
vector<int> primes;
void initPrimes(int n)
{
	isPrime = vector<unsigned char>(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	FOR(i, 2, n + 1)
	{
		if (!isPrime[i]) continue;
		primes.push_back(i);
		for (int j = i * 2; j <= n; j += i)
			isPrime[j] = false;
	}
}

//// Probability ////

// パスカルの三角形(二項定理) 2種類の並べ替えにつかう。
vector<vector<double>> makePascalTriangle(int n, bool probability = false)
{
	typedef vector<double> VD;
	vector<VD> t;
	if (!t.size()) { t.push_back(VD(1, 1)); }
	FOR(i, t.size(), n + 1)
	{
		t.push_back(VD(i + 1));
		REP(j, i)
		{
			double x = t[i - 1][j] * (probability ? 0.5 : 1);
			t[i][j] += x;
			t[i][j + 1] += x;
		}
	}
	return t;
}


//// iota iterator ////
struct iotait
{
	int n;
	iotait(int n = 0) : n(n) { }
	iotait &operator ++() { ++n; return *this; }
	int operator *() { return n; }
};

//// geo ////
struct P3
{
	double x, y, z;
	P3(double x = 0, double y = 0, double z = 0) : x(x), y(y), z(z) { }
	P3 operator +() const { return *this; }
	P3 operator +(const P3 &_) const { return P3(x + _.x, y + _.y, z + _.z); }
	P3 operator -() const { return P3(-x, -y, -z); }
	P3 operator -(const P3 &_) const { return *this + -_; }
	P3 operator *(double _) const { return P3(x*_, y*_, z*_); }
	P3 operator /(double _) const { return P3(x / _, y / _, z / _); }
	double dot(const P3 &_) const { return x*_.x + y*_.y + z*_.z; } // 内積
	P3 cross(const P3 &_) const { return P3(y*_.z - z*_.y, z*_.x - x*_.z, x*_.y - y*_.x); } // 外積
	double sqlength() const { return x*x + y*y + z*z; } // 二乗長さ
	double length() const { return sqrt(sqlength()); } // 長さ
	P3 direction() const { return *this / length(); } // 方向ベクトル
};
inline istream & operator>>(istream & in, P3 & p) { in >> p.x >> p.y >> p.z; return in; }
inline double abs(P3 p) { return p.length(); }

struct Sphere
{
	P3 c;
	double r;
	Sphere(double x, double y, double z, double r) : c(x, y, z), r(r) { }
	Sphere(P3 c, double r) : c(c), r(r) { }
	bool IntersectWith(const Sphere &rhs) const { return abs(c - rhs.c) - (r + rhs.r) < EPS; } // 接してても真。
};
inline istream & operator>>(istream & in, Sphere & c) { in >> c.c >> c.r; return in; }

struct P2
{
	double x, y;
	P2(double x = 0, double y = 0) : x(x), y(y) { }
	P2(complex<double> c) : x(c.real()), y(c.imag()) { }
	P2 operator +() const { return *this; }
	P2 operator +(const P2 &_) const { return P2(x + _.x, y + _.y); }
	P2 operator -() const { return P2(-x, -y); }
	P2 operator -(const P2 &_) const { return *this + -_; }
	P2 operator *(double _) const { return P2(x*_, y*_); }
	P2 operator /(double _) const { return P2(x / _, y / _); }
	double dot(const P2 &_) const { return x*_.x + y*_.y; } // 内積
	double cross(const P2 &_) const { return x*_.y - y*_.x; } // 外積
	double sqlength() const { return x*x + y*y; } // 二乗長さ
	double length() const { return sqrt(sqlength()); } // 長さ
	P2 orthogonal() const { return P2(y, -x); }
	P2 direction() const { return *this / length(); } // 方向ベクトル
};
inline istream & operator>>(istream & in, P2 & p) { in >> p.x >> p.y; return in; }
inline double abs(P2 p2) { return p2.length(); }
inline P2 orthogonal(P2 p) { return p.orthogonal(); }
inline complex<double> orthogonal(complex<double> c) { return  c * complex<double>(0, 1); }

// a,b から ちょうど d だけ離れた点。aとbを円周に持つ円の半径。
pair<P2, P2> get_same_distance_points(P2 a, P2 b, double d)
{
	assert(abs(a - b) <= 2 * d + EPS);
	auto v = (a + b) / 2.0 - a; // a から aとbの中点
	auto vl = abs(v);
	auto wl = sqrt(d*d - vl*vl); // 直行Vの大きさ
	auto w = orthogonal(v) * (wl / vl); // 直行V
	return make_pair(a + v + w, a + v - w);
}

struct Circle
{
	P2 c;
	double r;
	Circle(double x, double y, double r) : c(x, y), r(r) { }
	Circle(P2 c, double r) : c(c), r(r) { }
	bool IntersectWith(const Circle &rhs) const { return abs(c - rhs.c) - (r + rhs.r) < EPS; } // 接してても真。
	bool Contains(const P2 &p) const { return abs(p - c) - r < EPS; } // 接してても真。
};
inline istream & operator>>(istream & in, Circle & c) { in >> c.c >> c.r; return in; }

//// bit ////
#ifdef _MSC_VER
inline unsigned __builtin_ctz(unsigned x) { unsigned long r; _BitScanForward(&r, x); return r; }
#endif

inline int next_bit_permutation(int x)
{
	int t = x | (x - 1);
	return (t + 1) | (unsigned)((~t & -~t) - 1) >> (__builtin_ctz(x) + 1);
}

//// graph ////
struct Path
{
	int from;
	int to;
	double cost;
	Path(int from = 0, int to = 0, double cost = 0) : from(from), to(to), cost(cost) { }
	bool operator < (const Path &rhs) const { return cost < rhs.cost; }
	bool operator >(const Path &rhs) const { return cost > rhs.cost; }
};

// prim //
pair<double, vector<int>> prim(const vector<vector<double>> &costTable)
{
	int N = costTable.size();
	priority_queue<Path, vector<Path>, greater<Path>> q;
	q.push(Path(0, 0, 0));

	vector<int> parent(N, -1);
	double totalCost = 0;
	while (!q.empty())
	{
		Path cur = q.top(); q.pop();
		int i = cur.to;
		if (parent[i] != -1) continue;
		parent[i] = cur.from;
		totalCost += cur.cost;
		REP(j, N) if (parent[j] == -1) q.push(Path(i, j, costTable[i][j]));
	}
	return make_pair(totalCost, parent);
}

// dijkstra //
pair<vector<double>, vector<int>> dijkstra(const vector<vector<Path>> &routes, int start = 0, int goal = -1)
{
	int N = routes.size();
	priority_queue<Path, vector<Path>, greater<Path>> q;
	q.push(Path(start, start, 0));

	vector<int> prev(N, -1);
	vector<double> cost(N, INF);
	while (!q.empty())
	{
		Path cur = q.top(); q.pop();
		int i = cur.to;
		if (prev[i] != -1) continue;
		prev[i] = cur.from;
		cost[i] = cur.cost;
		if (i == goal) { break; }
		REP(j, routes[i].size())
		{
			Path next = Path(i, routes[i][j].to, cur.cost + routes[i][j].cost);
			if (prev[next.to] == -1)
				q.push(next);
		}
	}
	return make_pair(cost, prev);
}

//// i/o ////
template <class T>
class vevector : public vector<vector<T>>
{
public:
	vevector(int n = 0, int m = 0) : vector<vector<T>>(n, vector<T>(m)) { };
	vevector(int n, int m, const T &initial) : vector<vector<T>>(n, vector<T>(m, initial)) { };
};

template <class T> T read() { T t; cin >> t; return t; }
template <class T> vector<T> read(int n) { vector<T> v; REP(i, n) { v.push_back(read<T>()); } return v; }
template <class T> vevector<T> read(int n, int m) { vevector<T> v; REP(i, n) v.push_back(read<T>(m)); return v; }
template <class T> vevector<T> readjag(int n) { vevector<T> v; REP(i, n) v.push_back(read<T>(read<int>())); return v; }
template <class T> void write(const T &t) { cout << t << endl; }
template <class T> void write(const T &t, const T &t2) { cout << t << ' ' << t2 << endl; }
template <class T> void write(const vector<T> &v)
{
	ostringstream ss;
	for (auto x : v) ss << x << ' ';
	auto s = ss.str();
	cout << s.substr(0, s.length() - 1) << endl;
}
template<class T>
istream & operator>>(istream & in, complex<T> & n) { T r, i; in >> r >> i; n = complex<T>(r, i); return in; }

struct _Reader { template <class T> _Reader operator ,(T &rhs) { cin >> rhs; return *this; } };
#define READ(t,...) t __VA_ARGS__; _Reader(), __VA_ARGS__

template <class InIt1, class InIt2>
int partial_compare(InIt1 first1, InIt1 last1, InIt2 first2, InIt2 last2)
{
	return lexicographical_compare(first1, last1, first2, last2) ? -1
		: lexicographical_compare(first2, last2, first1, last1) ? 1
		: 0;
}

//// start up ////
void solve();
int main()
{
	// freopen("A.in", "r", stdin);
	solve();
	return 0;
}

////////////////////
/// template end ///
////////////////////

void solve()
{
	auto testcases = INF; // read<int>();
	REP(testcase, testcases)
	{
		READ(int, N);
		if (!N) { break; }

		auto ps = read<P2>(N);

		int result = 1;
		REP(i_, N) FOR(j_, i_ + 1, N)
		{
			const P2 i = ps[i_], j = ps[j_];
			double r = 1;
			if (abs(i - j) - 2 * r > -EPS) { continue; } // 遠すぎて円が作れない

			auto c = get_same_distance_points(i, j, r); // i と j から ちょうど r 離れた点

			auto c1 = Circle(c.first, r), c2 = Circle(c.second, r);
			result = max<int>(result, count_if(allof(ps), [c1, r](P2 p) { return c1.Contains(p); }));
			result = max<int>(result, count_if(allof(ps), [c2, r](P2 p) { return c2.Contains(p); }));
		}

		write(result);
	}

}

Measured memory_bytes: 1272