using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Math;
using static System.Array;
using static AtCoder.Tool;
namespace AtCoder
{
    class AC
    {
        const int mod = 1000000007;
        const int INF = int.MaxValue / 2;
        const long SINF = long.MaxValue / 2;
        const double EPS = 1e-8;
        //static readonly int[] dx = { 0, 1, 0, -1 };
        //static readonly int[] dy = { 1, 0, -1, 0 };
        

        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            var cin = new Scanner();

           
            while (true)
            {
                int N = int.Parse(Console.ReadLine());
                if (N == 0) {
                    //Console.Out.Flush();
                    break;
                }
                
                double[] x = new double[N];
                double[] y = new double[N];
                for(var i = 0; i < N; i++)
                {
                    var p = Console.ReadLine().Split().Select(double.Parse).ToArray();
                    x[i] = p[0];
                    y[i] = p[1];
                }
                if (N == 1)
                {
                    Console.WriteLine(1);
                    continue;
                }
                long ans = -1;

                for(var i = 0; i < N - 1; i++)
                {
                    for(var j = i + 1; j < N; j++)
                    {
                        double dx = x[j] - x[i];
                        double dy = y[j] - y[i];
                       
                        double r = Sqrt((dx * dx) + (dy * dy));
                        if (r > 2) {
                            ans = Max(ans, 1);
                            continue; }
                        double D = Sqrt(1 - ((r * r) / 4));

                        double vx = -dy * D / r;
                        double vy = dx * D / r;

                        var cx = new double[2];
                        var cy = new double[2];
                        cx[0] = x[i] + (dx / 2) + vx;
                        cx[1] = x[i] + (dx / 2) - vx;
                        cy[0] = y[i] + (dy / 2) + vy;
                        cy[1] = y[i] + (dy / 2) - vy;

                        

                        for (var k = 0; k <= 1; k++) 
                        {
                            long cnt = 2;
                            for (var l = 0; l < N; l++)
                            {
                                if (l == i || l == j) { continue; }
                                double dist = Sqrt(Pow(cx[k] - x[l], 2) + Pow(cy[k] - y[l], 2));
                                if (dist < 1 + EPS)  { cnt++; }
                            }
                            ans = Max(ans, cnt);
                        }
                    }
                }


                Console.WriteLine(ans);
                
                
            }
            
            Console.Out.Flush();

        }
        
    }
    
    public class Scanner
    {
        public int[] SplitRead()
        {
            int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return array;
        }
        public long[] SplitReadL()
        {
            long[] array = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return array;
        }
    }

    public static class Tool
    {
        static public void Initialize<T>(ref T[] array, T initialvalue)
        {
            for (var i = 0; i < array.Length; i++)
            {
                array[i] = initialvalue;
            }
        }
    }
}



Measured memory_bytes: 20368