#include <iostream>
#include <cmath>
#include <vector>
#include <utility>
#include <algorithm>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define vec vector
#define pdd pair<double, double>
#define mp make_pair

double dis(pdd a, pdd b)
{
	pdd x = mp(a.first - b.first, a.second - b.second);
	return sqrt(x.first * x.first + x.second * x.second);
}

pdd find(pdd a, pdd b)
{
	pdd v = mp(a.first - b.first, a.second - b.second);
	double d = sqrt(v.first * v.first + v.second * v.second);
	// double d = dis(a, b);
	if (d > 2.0) return mp(1000, 1000);
	// pdd o = mp(a.first + 0.5 * v.first, a.second + 0.5 * v.second);
	pdd o = mp((a.first + b.first) / 2.0, (a.second + b.second) / 2.0);
	pdd g = mp(v.second, - v.first);
	double s = sqrt(1.0 - d * d / 4.0);
	// double g_size = sqrt(g.first * g.first + g.second * g.second);
	double g_size = d;
	pdd ret = mp(o.first + g.first / g_size * s, o.second + g.second / g_size * s);
	return ret;
}

int main(void)
{
	while(1) {
		int n;
		cin >> n;
		if (n == 0) break;
		vec<pdd> a(n);
		rep(i, n) cin >> a[i].first >> a[i].second;
		if (n == 1) {
			cout << 1 << endl;
			continue;
		}

		int MAX = 0;
		rep(i, n) rep(j, n) {
			if (i == j) continue;
			pdd c = find(a[i], a[j]);
			// cout << i << " " << j << " " << c.first << " " << c.second << endl;

			int p = 0;
			if (c.first == 1000) p = 1;
			else {
					rep(k, n) {
					// cout << dis(a[k], c) << " ";
					if (dis(a[k], c) <= 1.0001) p++;
				}
			}
			// cout << p << endl;
			MAX = max(p, MAX);
		}

		cout << MAX << endl;
	}
	return 0;
}