// Circle and Points

// 平面走査ごり押し
// wrong answer
// EPS変えてもダメ　1e-3, 1e-5, 1e-10, 1e-12

#include<iostream>
#include<cmath>     // fabs(), hypot()
#include<vector>    // Circle().crosspoint()の戻り値
using namespace std;

const double EPS = 1e-10;
// class
class Point;
class Segment;
class Line;
class Circle;
// member
class Point {
public:
    double x, y;
    Point(double a = 0.0, double b = 0.0) :x(a), y(b) {};
    bool operator== (const Point&) const;
    bool operator< (const Point&) const;
    bool operator> (const Point&) const;
    bool operator<= (const Point&) const;
    bool operator>= (const Point&) const;
    Point operator+(const Point&) const;
    Point operator-(const Point&) const;
    Point operator-() const;
    Point times(double) const;
    Point& operator=(const Point&);
    Point& operator+=(const Point&);
    Point& operator-=(const Point&);
    double dot(const Point&) const;
    double cross(const Point&) const;
    double abs() const;
    double norm() const;
    double distance(const Point&) const;
    double distance(const Segment&) const;
    double distance(const Line&) const;
    bool intersect(const Point&) const;
    bool intersect(const Segment&) const;
    bool intersect(const Line&) const;
    Point projection(const Line&) const;
    Point reflection(const Line&) const;
    int ccw(const Point&, const Point&) const;              // a.ccw(b, p)で3点a, b, pの位置関係を返す
                                                            //   0: a-p-b, 2: p-a-b, -2: a-b-p, 1: -a-b-の上にp, -1: -a-b-の下にp
};
class Segment {
public:
    Point source, target;
    Segment(Point a = Point(), Point b = Point()) :source(a), target(b) {};
    Line line() const;
    double distance(const Point&) const;
    double distance(const Segment&) const;
    double distance(const Line&) const;
    bool intersect(const Point&) const;
    bool intersect(const Segment&) const;
    bool intersect(const Line&) const;
};
class Line {
public:
    Point source, target;
    Line(Point a = Point(), Point b = Point()) :source(a), target(b) {};
    Segment segment() const;
    double distance(const Point&) const;
    double distance(const Segment&) const;
    double distance(const Line&) const;
    bool intersect(const Point&) const;
    bool intersect(const Segment&) const;
    bool intersect(const Line&) const;
    Point projection(const Point&) const;
    Point reflection(const Point&) const;
    Point crosspoint(const Line&) const;
};
class Circle {
public:
    double x, y, r;
    Circle(double a = 0.0, double b = 0.0, double c = 0.0) :x(a), y(b), r(c) {};
    Point point() const;
    double distance(const Point&) const;                    // 円の中心と点の距離
    double distance(const Circle&) const;                   // 円の中心同士の距離
    bool include(const Point&) const;                       // 点を含むか
    bool include(const Circle&) const;                      // 円を含むか
    bool intersect(const Circle&) const;
    vector<Point> crosspoint(const Circle&) const;
};
// Point
bool Point::operator== (const Point &p) const {return x == p.x && y == p.y;}
bool Point::operator<(const Point &p) const {return x != p.x ? x < p.x : y < p.y;}
bool Point::operator>(const Point &p) const {return x != p.x ? x > p.x : y > p.y;}
bool Point::operator<=(const Point &p) const {return x != p.x ? x < p.x : y <= p.y;}
bool Point::operator>=(const Point &p) const {return x != p.x ? x > p.x : y >= p.y;}
Point Point::operator+(const Point& p) const {return Point(x + p.x, y + p.y);}
Point Point::operator-(const Point& p) const {return Point(x - p.x, y - p.y);}
Point Point::operator-() const {return Point(-x, -y);}
Point Point::times(double d) const {return Point(x * d, y * d);}
Point& Point::operator=(const Point& p) {x = p.x; y = p.y; return *this;}
Point& Point::operator+=(const Point& p) {x += p.x; y += p.y; return *this;}
Point& Point::operator-=(const Point& p) {x -= p.x; y -= p.y; return *this;}
double Point::dot(const Point& p) const {return x * p.x + y * p.y;}
double Point::cross(const Point& p) const {return x * p.y - y * p.x;}
double Point::abs() const {return hypot(x, y);}
double Point::norm() const {return x * x + y * y;}
double Point::distance(const Point& p) const {return (p - (*this)).abs();}
double Point::distance(const Segment& s) const {return s.distance(*this);}
double Point::distance(const Line& l) const {return l.distance(*this);}
bool Point::intersect(const Point& p) const {return *this == p;}
bool Point::intersect(const Segment& s) const {return s.intersect(*this);}
bool Point::intersect(const Line& l) const {return l.intersect(*this);}
Point Point::projection(const Line& l) const {return l.projection(*this);}
Point Point::reflection(const Line& l) const {return l.reflection(*this);}
int Point::ccw(const Point& b, const Point& p) const {
    const Point& a = *this;
    Point v1 = b - a;
    Point v2 = p - a;
    if(v1.cross(v2) > 0.0) return 1;
    if(v1.cross(v2) < 0.0) return -1;
    if(v1.dot(v2) < 0.0) return 2;
    if(v1.norm() < v2.norm()) return -2;
    return 0;
}
// Segment
Line Segment::line() const {return Line(source, target);}
double Segment::distance(const Point& p) const {
    Point q = line().projection(p);
    if(intersect(q)) return q.distance(p);
    double a = source.distance(p);
    double b = target.distance(p);
    return a < b ? a : b;
}
double Segment::distance(const Segment& s) const {
    if(intersect(s)) return 0.0;
    double a = distance(s.source);
    double b = distance(s.target);
    double c = s.distance(source);
    double d = s.distance(target);
    a = a < b ? a : b;
    a = a < c ? a : c;
    return a < d ? a : d;
}
double Segment::distance(const Line& l) const {return l.distance(*this);}
bool Segment::intersect(const Point& p) const {
    return source.distance(p) + target.distance(p) - target.distance(source) <= EPS;
}
bool Segment::intersect(const Segment& s) const {
    bool a = s.source.ccw(s.target, source) * s.source.ccw(s.target, target) <= EPS;
    bool b = source.ccw(target, s.source) * source.ccw(target, s.target) <= EPS;
    return a && b;
}
bool Segment::intersect(const Line& l) const {return l.intersect(*this);}
// Line
Segment Line::segment() const {return Segment(source, target);}
double Line::distance(const Point& p) const {return p.distance(projection(p));}
double Line::distance(const Segment& s) const {
    if(intersect(s)) return 0.0;
    double a = distance(s.source);
    double b = distance(s.target);
    return a < b ? a : b;
}
double Line::distance(const Line& l) const {return intersect(l) ? 0.0 : distance(l.source);}
bool Line::intersect(const Point& p) const {
    Point v1 = source - p;
    Point v2 = target - p;
    return fabs(v2.cross(v1)) < EPS;
}
bool Line::intersect(const Segment& s) const {
    Point v1 = target - source;
    Point v2 = s.source - source;
    Point v3 = s.target - source;
    return v1.cross(v2) * v1.cross(v3) <= EPS;
}
bool Line::intersect(const Line& l) const {
    Point v1 = target - source;
    Point v2 = l.target - l.source;
    Point v3 = l.source - source;
    return fabs(v1.cross(v2)) > EPS || fabs(v1.cross(v3)) < EPS;
}
Point Line::projection(const Point& p) const {
    Point v1 = p - source;
    Point v2 = source - target;
    return Point(source + v2.times(v1.dot(v2) / v2.norm()));
}
Point Line::reflection(const Point& p) const {
    return p + (projection(p) - p).times(2.0);
}
Point Line::crosspoint(const Line& l) const {
    Point v1 = target - source;
    Point v2 = l.target - l.source;
    Point v3 = target - l.source;
    double a = v1.cross(v2);
    double b = v1.cross(v3);
    if(fabs(a) <= EPS && fabs(b) <= EPS) l.source;
    return l.source + v2.times(b / a);
}
// Circle
Point Circle::point() const {return Point(x, y);}
double Circle::distance(const Point& p) const {return point().distance(p);}
double Circle::distance(const Circle& c) const {return point().distance(c.point());}
bool Circle::include(const Point& p) const {return distance(p) - r <= EPS;}
bool Circle::include(const Circle& c) const {return distance(c) - (r - c.r) <= EPS;}
bool Circle::intersect(const Circle& c) const {return distance(c) - r - c.r <= EPS;}
vector<Point> Circle::crosspoint(const Circle& c) const {
    double angle = atan2(c.y - y, c.x - x);
    double d = distance(c);
    double add = acos((d * d + r * r - c.r * c.r) / (2.0 * d * r));
    vector<Point> result;
    result.push_back(Point(x + r * cos(angle + add), y + r * sin(angle + add)));
    result.push_back(Point(x + r * cos(angle - add), y + r * sin(angle - add)));
    return result;
}

int main() {
    int n;
    while(cin>>n, n) {
        vector<Circle> circle;
        vector<Circle> crosspoint;
        for(int i = 0; i < n; i++) {
            double x, y;
            cin>>x>>y;
            circle.push_back(Circle(x, y, 1.0));
            crosspoint.push_back(Circle(x, y, 1.0));
        }
        for(int i = 0; i < n - 1; i++) {
            for(int j = i + 1; j < n; j++) {
                if(!circle[i].intersect(circle[j])) continue;
                vector<Point> p = circle[i].crosspoint(circle[j]);
                crosspoint.push_back(Circle(p[0].x, p[0].y, 1.0));
                crosspoint.push_back(Circle(p[1].x, p[1].y, 1.0));
            }
        }
        int answer = 0;
        for(int i = 0; i < crosspoint.size(); i++) {
            int count = 0;
            for(int j = 0; j < n; j++) {
                if(crosspoint[i].include(circle[j].point())) count++;
            }
            if(answer < count) answer = count;
        }
        cout<<answer<<endl;
    }
}

Measured memory_bytes: 2584