import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;
void log(A...)(A arg) { stderr.writeln(arg); }
int size(T)(in T s) { return cast(int)s.length; }

immutable real EPS = 1e-7;

struct Point {
    real x, y;
    Point opBinary(string op)(in Point p) const if (op == "+" || op == "-") {
        return Point(mixin("x" ~ op ~ "p.x"), mixin("y" ~ op ~ "p.y"));
    }
    Point opBinary(string op)(real k) const if (op == "*" || op == "/") {
        return Point(mixin("x" ~ op ~ "k"), mixin("y" ~ op ~ "k"));
    }
};
real dot(in Point a, in Point b) { return a.x * b.x + a.y * b.y; }
real cross(in Point a, in Point b) { return a.x * b.y - a.y * b.x; }
real norm(in Point a) { return sqrt(dot(a, a)); }
Point rot90(in Point p) { return Point(-p.y, p.x); }
real angle(in Point a) { return atan2(a.y, a.x); }
bool approxEqual(in Point a, in Point b) { return abs(a.x - b.x) < EPS && abs(a.y - b.y) < EPS; }

int ccw(Point a, Point b, Point c){
    b = b - a; c = c - a;                                          
    if (cross(b, c) > EPS) return +1;      // a,b,c????????????????¨???¨???
    if (cross(b, c) < -EPS) return -1;     // a,b,c?????????????¨???¨???                       
    if (dot(b, c) < 0) return +2;          // c--a--b ??´???                       
    if (norm(b) < norm(c)) return -2;      // a--b--c ??´???                       
    return 0;                              // a--c--b ??´???
}

struct Line {
    Point a, b;
};
bool contains(in Line l, in Point p) { return ccw(l.a, l.b, p) % 2 == 0; }
bool parallel(in Line s, in Line t) { return abs(cross(s.b - s.a, t.b - t.a)) < EPS; }
bool orthogonal(in Line s, in Line t) { return abs(dot(s.b - s.a, t.b - t.a)) < EPS; }
bool equals(in Line s, in Line t) { return parallel(s, t) && contains(s, t.a); }
Point crosspoint(in Line s, in Line t) {
    real d = cross(t.b - t.a, s.b - s.a);
    assert(abs(d) >= EPS);
    return s.a + (s.b - s.a) * cross(t.b - t.a, t.b - s.a) / d;
}


Point projection(in Line l, in Point p) {
    Point u = (p - l.a), v = (l.b - l.a);
    return l.a + (v / norm(v)) * (dot(u, v) / norm(v));
}
Point reflection(in Line l, in Point p) {
    Point h = projection(l, p);
    return p + (h - p) * 2;
}

struct Segment {
    Point a, b;
};
bool intersects(in Segment s, in Segment t) {
    return ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0 && ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0;
}
bool intersects_interior(in Segment s, in Segment t) {
    return (ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b)) % 2 < 0 && (ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b)) % 2 < 0;
}
unittest {
    auto s = Segment(Point(0, 0), Point(2, 2));
    {
        auto t = Segment(Point(1, 0), Point(1, 1));
        assert(s.intersects_interior(t) == false);
    }
    {
        auto t = Segment(Point(1, 0), Point(0, 1));
        assert(s.intersects_interior(t) == true);
    }
    {
        auto t = Segment(Point(2, 0), Point(2, 2));
        assert(s.intersects_interior(t) == false);
    }
    {
        auto t = Segment(Point(2, 0), Point(2, 4));
        assert(s.intersects_interior(t) == false);
    }
}
bool approxEqual(in Segment s, in Segment t) {
    return (approxEqual(s.a, t.a) && approxEqual(s.b, t.b)) ||
           (approxEqual(s.a, t.b) && approxEqual(s.b, t.a));
}
bool contains(in Segment s, in Point p) {
    return ccw(s.a, s.b, p) == 0;
}
bool intersects(in Line l, in Segment s) {
    if (l.parallel(cast(Line)s)) return false;
    auto p = l.crosspoint(cast(Line)s);
    return s.contains(p);
}
real dist(in Segment s, in Point p) {
    Point q = projection(Line(s.a, s.b), p);
    auto t = Segment(p, q);
    if (intersects(s, t)) return norm(t.b - t.a);
    return min(norm(s.a - p), norm(s.b - p));
}
real dist(in Segment s, in Segment t) {
    if (intersects(s, t)) return 0;
    return min( min(dist(s, t.a), dist(s, t.b)),
                min(dist(t, s.a), dist(t, s.b)) );
}
Line bisector(in Segment s) {
    // s????????´?????????????????????
    Point p = (s.a + s.b) / 2;
    Point v = s.b - s.a;
    Point q = p + v.rot90();
    return Line(p, q);
}

struct Polygon {
    Point[] vs;
    int size() const { return cast(int)vs.length; }
    bool approxEqual(in Polygon P) const {
        if (size() != P.size()) return false;
        int n = size();
        auto start = vs[0];
        int Pfrom = 0;
        bool found = false;
        foreach (int i, p; P.vs) {
            if (p.approxEqual(start)) {
                Pfrom = i;
                found = true;
            }
        }
        if (!found) return false;
        for (int i = 0; i < n; i++) {
            if (! vs[i].approxEqual(P.vs[(Pfrom + i) % n])) return false;
        }
        return true;
    }
    Segment[] edges() const {
        int n = size();
        Segment[] ss;
        for (int i = 0; i < n; i++) {
            ss ~= Segment(vs[i], vs[(i + 1) % n]);
        }
        return ss;
    }
}
real length(in Polygon P) {
    int n = P.size();
    real ret = 0;
    for (int i = 0; i < n; i++) {
        int j = (i + 1) % n;
        ret += norm(P.vs[i] - P.vs[j]);
    }
    return ret;
}
bool contains(in Polygon polygon, in Point p) {
    auto vs = polygon.vs;
    int N = cast(int)vs.length;
    int next(int i) { return (i + 1) % N; }
    int count = 0;
    foreach (int i; 0 .. N) {
        auto a = vs[i] - p;
        auto b = vs[next(i)] - p;
        if (abs(cross(a, b)) < EPS && dot(a, b) < EPS) return true; // ?????????p
        if (a.y > b.y) swap(a, b);
        if (a.y < EPS && EPS < b.y && cross(a, b) > EPS) {
            count++;
        }
    }
    return count % 2 == 1;
}
bool contains_interior(in Polygon polygon, in Point p) {
    auto vs = polygon.vs;
    int N = cast(int)vs.length;
    int next(int i) { return (i + 1) % N; }
    int count = 0;
    foreach (int i; 0 .. N) {
        auto a = vs[i] - p;
        auto b = vs[next(i)] - p;
        if (abs(cross(a, b)) < EPS && dot(a, b) < EPS) return false; // ?????????p
        if (a.y > b.y) swap(a, b);
        if (a.y < EPS && EPS < b.y && cross(a, b) > EPS) {
            count++;
        }
    }
    return count % 2 == 1;
}
bool contains_border(in Polygon polygon, in Point p) {
    return polygon.contains(p) && !polygon.contains_interior(p);
}
Polygon[2] split(in Polygon P, in Line l) {
    // ???????§???¢P???l??§?????????, [P.vs[0]???????????´, ??????????????´] ?????????
    int n = cast(int)(P.vs.length);
    const Point[] vs = P.vs;
    Point[][] ret = new Point[][2];
    int state = 0;
    for (int cur = 0; cur < n; cur++) {
        int next = (cur + 1) % n;
        Segment s = Segment(vs[cur], vs[next]);
        if (l.intersects(s)) {
            Point m = l.crosspoint(cast(Line)s);
            if (m.approxEqual(vs[next])) {
                if (cur < n - 1) {
                    ret[state] ~= vs[next];
                    ret[!state] ~= vs[next]; 
                    auto nnext = (next + 1) % n;
                    ret[!state] ~= vs[nnext];
                }
                cur++;
            } else {
                ret[state] ~= m; ret[!state] ~= m; ret[!state] ~= vs[next];
            }
            state = !state;
        } else {
            ret[state] ~= vs[next];
        }
    }
    return [Polygon(ret[0]), Polygon(ret[1])];
}
unittest {
    // unittest for split(Polygon, Polygon);
    auto R = Polygon([
        Point(0, 0),
        Point(1, 0),
        Point(1, 1),
        Point(0, 1)
    ]);
    {
        auto l = Line(Point(0, 0.5), Point(1, 0.5));
        auto Ps = R.split(l);
        assert(Ps[0].approxEqual(
            Polygon([Point(1, 0), Point(1, 0.5), Point(0, 0.5), Point(0, 0)])
        ));
        assert(Ps[1].approxEqual(
            Polygon([Point(1, 0.5), Point(1, 1), Point(0, 1), Point(0, 0.5)])
        ));
    }
    {
        auto l = Line(Point(0, 0), Point(1, 1));
        auto Ps = R.split(l);
        assert(Ps[0].approxEqual(
            Polygon([Point(0, 0), Point(1, 1), Point(0, 1)])
        ));
        assert(Ps[1].approxEqual(
            Polygon([Point(0, 0), Point(1, 0), Point(1, 1)])
        ));
    }
}
Point[] convexHull(in Point[] _ps) {
    auto ps = _ps.dup;
    assert(ps.size() >= 3);
    ps.sort!((a, b) => abs(a.x - b.x) < EPS ? a.y < b.y : a.x < b.x);
    int N = ps.size;
    int k = 0;
    auto ans = new Point[2 * N];
    for (int i = 0; i < N; ans[k++] = ps[i++])
        while (k >= 2 && ccw(ans[k - 2], ans[k - 1], ps[i]) <= 0) k--;
    for (int i = N - 2, t = k + 1; i >= 0; ans[k++] = ps[i--])
        while (k >= t && ccw(ans[k - 2], ans[k - 1], ps[i]) <= 0) k--;
    return ans[0 .. k - 1];
}
Point[] crosspoints(in Polygon P, in Polygon Q) {
    int n = P.size();
    int m = Q.size();
    Point[] cs = P.vs.dup ~ Q.vs.dup;
    for (int i = 0; i < n; i++) {
        auto s = Segment(P.vs[i], P.vs[(i + 1) % n]);
        for (int j = 0; j < m; j++) {
            auto t = Segment(Q.vs[j], Q.vs[(j + 1) % m]);
            if (s.intersects(t) && !(cast(Line)s).parallel(cast(Line)t)) {
                cs ~= (cast(Line)s).crosspoint(cast(Line)t);
            }
        }
    }
    return unique(cs);
}
Polygon intersection(in Polygon P, in Polygon Q) {
    auto cs = crosspoints(P, Q);
    Point[] vs;
    foreach (c; cs) {
        if (P.contains(c) && Q.contains(c)) {
            vs ~= c;
        }
    }
    return Polygon(vs.convexHull());
}
Polygon reflection(in Line l, in Polygon P) {
    Point[] vs;
    foreach (v; P.vs) {
        vs ~= l.reflection(v);
    }
    reverse(vs);
    return Polygon(vs);
}

Point[] unique(in Point[] xs) {
    int n = xs.size();
    auto dup = new bool[n];
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < i; j++) {
            if (xs[i].approxEqual(xs[j])) {
                dup[i] = true;
                j = i;
                break;
            }
        }
    }
    Point[] ret;
    foreach (i; 0 .. n) {
        if (dup[i]) continue;
        ret ~= xs[i];
    }
    return ret;
}

void main() {
    int N;
    Polygon P;
    bool input() {
        readf("%d\n", &N);
        if (N == 0) return false;
        Point[] vs;
        foreach (i; 0 .. N) {
            real x, y;
            readf("%f %f\n", &x, &y);
            vs ~= Point(x, y);
        }
        P = Polygon(vs);
        return true;
    }

    void solve() {
        ulong vcount = 0;
        real length = 0;
        for (int i = 0; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                auto l = Segment(P.vs[i], P.vs[j]).bisector();
                auto Ps = P.split(l);
                auto X = l.reflection(Ps[0]);
                auto Y = Ps[1];
                auto R = intersection(X, Y);
                real len = X.length() + Y.length() - R.length();
                int count = X.size() + Y.size() - R.size();
                foreach (s; X.edges()) {
                    foreach (t; Y.edges()) {
                        if (s.intersects_interior(t) && !(cast(Line)s).parallel(cast(Line)t)) {
                            count += 2;
                        }
                        if (s.intersects(t) && (cast(Line)s).parallel(cast(Line)t)) {
                            if (s.contains(t.a) && s.contains(t.b)) continue;
                            if (t.contains(s.a) && t.contains(s.b)) continue;
                            auto x = (s.contains(t.a) ? t.a : t.b);
                            auto y = (t.contains(s.a) ? s.a : s.b);
                            if (approxEqual(x, y)) {
                                count--;
                            }
                        }
                    }
                }
                //writefln("----(%s, %s)=>%s----\n===X===\n%s\n===Y===\n%s\n===R===\n%s\nlen:%s, count:%s", i, j, l, X, Y, R, len, count);
                //writeln();
                if (count > vcount) {
                    vcount = count;
                    length = len;
                } else if (count == vcount) {
                    length = max(length, len);
                }
            }
        }
        writefln("%.15f", length);
    }

    while (input()) solve();

}

Measured memory_bytes: 3332