// Arup Guha
// 11/17/2015
// Solution to SER D1 Problem: Coverage

import java.util.*;

public class coverage {

	public static int n;
	public static circle[] towers;
	public static int[] comp;
	public static HashSet[] lists;
	public static int numComp;

	public static void main(String[] args) {

		// Initialize stuff.
		Scanner stdin = new Scanner(System.in);
		n = stdin.nextInt();
		towers = new circle[n];
		comp = new int[n];
		Arrays.fill(comp, -1);
		numComp = 0;

		// Read in towers.
		for (int i=0; i<n; i++) {
			double x = stdin.nextDouble();
			double y = stdin.nextDouble();
			towers[i] = new circle(x,y);
		}

		// Find connected components.
		for (int i=0; i<n; i++) {
			if (comp[i] == -1) {
				dfs(i);
				numComp++;
			}
		}

		// Will store members of each component here.
		lists = new HashSet[numComp];
		for (int i=0; i<numComp; i++)
			lists[i] = new HashSet<Integer>();
		for (int i=0; i<n; i++)
			lists[comp[i]].add(i);

		// Output the result.
		System.out.println(solve());
	}

	// Solves the problem.
	public static int solve() {

		// Trivial case.
		if (numComp == 1) return n+1;

		// At the very least, we can attach ourselves to one region.
		int res = 1;
		for (int i=0; i<numComp; i++)
			res = Math.max(res, lists[i].size()+1);

		// Try building a tower connected to tower i.
		for (int i=0; i<n; i++) {

			// Will store all circles in different components that are in range.
			ArrayList<Integer> near = new ArrayList<Integer>();

			// Try all other circles.
			for (int j=0; j<n; j++)
				if (comp[i] != comp[j] && towers[i].inRange(towers[j]))
					near.add(j);

			// Set up ranges of angular intersection here.
			int len = near.size();
			double[][] ranges = new double[len][2];
			for (int j=0; j<near.size(); j++)
				ranges[j] = towers[i].getRange(towers[near.get(j)]);

			// Store end points of ranges in sweepable format.
			item[] points = new item[len*2];
			for (int j=0; j<len; j++) {
				points[2*j] = new item(ranges[j][0], near.get(j), true);
				points[2*j+1] = new item(ranges[j][1], near.get(j), false);
			}

			// Sort it for our sweep.
			Arrays.sort(points);

			// freq[i] = # of circles that are on from component i.
			int[] freq = new int[numComp];
			HashSet<Integer> connectedList = new HashSet<Integer>();
			connectedList.add(comp[i]);
			int cur = lists[comp[i]].size()+1;

			// Do our sweep.
			for (int j=0; j<points.length; j++) {

				// Entered a new intersection.
				if (points[j].on) {
					freq[comp[points[j].index]]++;

					// New connected component.
					if (freq[comp[points[j].index]] == 1) {
						cur += lists[comp[points[j].index]].size();
						res = Math.max(res, cur);
					}
				}

				// Leaving a circle.
				else {
					freq[comp[points[j].index]]--;

					// Losing a connected component.
					if (freq[comp[points[j].index]] == 0)
						cur -= lists[comp[points[j].index]].size();
				}
			}
		}

		return res;
	}

	public static void dfs(int loc) {

		// Mark this node's component number.
		comp[loc] = numComp;

		// Go to all unvisited neighbors.
		for (int i=0; i<n; i++)
			if (comp[i] == -1 && towers[loc].touch(towers[i]))
				dfs(i);
	}
}

class circle {

	// All circles have radius 1.
	final public static double r = 1;

	public double x;
	public double y;

	public circle(double myx, double myy) {
		x = myx;
		y = myy;
	}

	// Condition when two circles intersect.
	public boolean touch(circle other) {
		return dist(other) < 2*r;
	}

	// Condition when two circles DON'T intersect, but a third circle could connect the two.
	public boolean inRange(circle other) {
		double d = dist(other);
		return d > 2*r && d < 4*r;
	}

	// Pre-condition: this is inRange of other.
	// Post-condition: returns the range of angles from this that will allow a third circle to connect the two.
	public double[] getRange(circle other) {
		double baseAngle = Math.atan2(other.y-this.y, other.x-this.x);
		double halfAngle = Math.acos(dist(other)/(4*r));

		// All cases are correct but I feel this could break somehow.
		return new double[]{baseAngle-halfAngle, baseAngle+halfAngle};
	}

	// Returns the distance between this and other's centers.
	public double dist(circle other) {
		return Math.sqrt((x-other.x)*(x-other.x)+(y-other.y)*(y-other.y));
	}
}

// Utility class to help us with our sweep of important angles.
class item implements Comparable<item> {

	public double angle;
	public int index;
	public boolean on;

	public item(double a, int i, boolean up) {
		angle = a;
		index = i;
		on = up;
	}

	public int compareTo(item other) {
		if (this.angle < other.angle) return -1;
		if (this.angle > other.angle) return 1;
		return 0;
	}
}
