#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-8;

int main() {
	for (;;) {
		int N; cin >> N;
		if (N == 0) break;
		vector<double> x(N), y(N);
		for (int i = 0; i < N; i++)
			cin >> x[i] >> y[i];
		int maxi = 1;
		for (int i = 0; i < N; i++)
			for (int j = 0; j < N; j++) {
				if (i == j) continue;
				double dx = x[j] - x[i], dy = y[j] - y[i];
				double d = sqrt(dx * dx + dy * dy);
				if (d > 2) continue;
				double h = sqrt(1 - d * d / 4);
				double ox = x[i] + dx / 2 - dy / d * h;
				double oy = y[i] + dy / 2 + dx / d * h;
				int cnt = 0;
				for (int k = 0; k < N; k++) {
					double dx = x[k] - ox, dy = y[k] - oy;
					double d = sqrt(dx * dx + dy * dy);
					if (d <= 1 + EPS) cnt++;
				}
				maxi = max(maxi, cnt);
			}
		cout << maxi << endl;
	}
}