/*
 * Copyright (c) 2004 Kamo Hiroyasu
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/*
 * Circle and Points
 *  Author: Kamo Hiroyasu <wd@ics.nara-wu.ac.jp>
 */

#include <math.h>
#include <stdio.h>
#include <stdlib.h>

struct point {
	double		x, y;
};

int	count_points(const struct point *, int, double);
int	fgetpoints(struct point **, FILE *);

#define getpoints(p)	fgetpoints((p), stdin)

static int
is_on_disk(const struct point *p, const struct point *c, double rr)
{
	double		x, y;

	x = p->x - c->x;
	y = p->y - c->y;
	return x * x + y * y <= rr;
}

static int
calc_centers(const struct point *a, const struct point *b, double rr,
	     struct point *c)
{
	double		dx, dy, mx, my, h, hx, hy;
	double		dd;

	dx = (a->x - b->x) / 2;
	dy = (a->y - b->y) / 2;
	dd = dx * dx + dy * dy;
	h = rr / dd - 1;
	if (h >= 0) {
		h = sqrt(h);
		hx = h * dy;
		mx = (a->x + b->x) / 2;
		c[0].x = mx + hx;
		c[1].x = mx - hx;
		hy = h * dx;
		my = (a->y + b->y) / 2;
		c[0].y = my - hy;
		c[1].y = my + hy;
		return 2;
	} else {
		return 0;
	}
}

int
count_points(const struct point *p, int n, double r)
{
	double		rr;
	int		s, t;
	int		i, j, k, l, m;
	struct point	c[2];

	rr = r * r;
	s = 1;
	for (i = 1; i < n; i ++) {
		for (j = 0; j < i; j ++) {
			m = calc_centers(&p[j], &p[i], rr, c);
			for (k = 0; k < m; k ++) {
				t = 2;
				for (l = 0; l < j; l ++) {
					if (is_on_disk(&p[l], &c[k], rr)) {
						t ++;
					}
				}
				for (l = j + 1; l < i; l ++) {
					if (is_on_disk(&p[l], &c[k], rr)) {
						t ++;
					}
				}
				for (l = i + 1; l < n; l ++) {
					if (is_on_disk(&p[l], &c[k], rr)) {
						t ++;
					}
				}
				if (s < t) {
					s = t;
				}
			}
		}
	}
	return s;
}

int
fgetpoints(struct point **pp, FILE *fp)
{
	int		i, n;
	struct point	*p;

	if (fscanf(fp, "%d", &n) != 1 || n < 0) {
		return -1;
	}
	p = malloc(n * sizeof(struct point));
	if (p == NULL) {
		return -1;
	}
	for (i = 0; i < n; i ++) {
		if (fscanf(fp, "%lf%lf", &p[i].x, &p[i].y) != 2) {
			free(p);
			return -1;
		}
	}
	*pp = p;
	return n;
}

main()
{
	int		n;
	struct point	*p;

	while ((n = getpoints(&p)) > 0) {
		printf("%d\n", count_points(p, n, 1.0));
		free(p);
	}
	return n == 0 ? 0 : 1;
}
