Problem: You are given an strictly convex polygon with n vertices. It is guaranteed that no three points are collinear. You would like to take a maximum non intersecting path on the polygon vertices that visits each point at most once.

More specifically your path can be represented as some sequence of distinct polygon vertices. Your path is the straight line segments between adjacent vertices in order. These segments are not allowed to touch or intersect each other except at the vertices in your sequence.

Given the polygon, print the maximum length non-intersecting path that visits each point at most once.

Input

The first line of input will contain a single integer n (2 ≤ n ≤ 2 500), the number of points.

The next n lines will contain two integers xi, yi (|xi|, |yi| ≤ 109), denoting the coordinates of the i-th vertex.

It is guaranteed that these points are listed in clockwise order.

Output

Print a single floating point number, representing the longest non-intersecting path that visits the vertices at most once.

Your answer will be accepted if it has absolute or relative error at most 10 - 9. More specifically, if your answer is a and the jury answer is b, your answer will be accepted if <image>.

Example

Input

4
0 0
0 1
1 1
1 0


Output

3.4142135624

Note

One optimal path is to visit points 0,1,3,2 in order.

Solution (in JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        int[] x;
        int[] y;
        double[][][] dp;
        int[] id;

        double SQR(double x) {
            return x * x;
        }

        double dist(int i, int j) {
            return Math.sqrt(SQR(x[i] - x[j]) + SQR(y[i] - y[j]));
        }

        double rec(int first, int last, int h) {

            if (dp[id[first]][id[last]][h] > -1) return dp[id[first]][id[last]][h];
            if (last - first + 1 == 2) {
                return dp[id[first]][id[last]][h] = dist(id[last], id[first]);
            } else {
                switch (h) {
                    case 0: {
                        double tmp = rec(first + 1, last, 0) + dist(id[first], id[first + 1]);
                        tmp = Math.max(tmp, rec(first + 1, last, 1) + dist(id[first], id[last]));
                        return dp[id[first]][id[last]][h] = tmp;
                    }
                    case 1: {
                        double tmp = rec(first, last - 1, 1) + dist(id[last], id[last - 1]);
                        tmp = Math.max(tmp, rec(first, last - 1, 0) + dist(id[last], id[first]));
                        return dp[id[first]][id[last]][h] = tmp;
                    }
                }
            }
            assert (false);
            return 0;
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            dp = new double[n][n][2];
            for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) for (int k = 0; k < 2; ++k) dp[i][j][k] = -1;
            x = new int[n];
            y = new int[n];
            for (int i = 0; i < n; ++i) {
                //poly.lp.add(new Point(in.nextInt(),in.nextInt()));
                x[i] = in.nextInt();
                y[i] = in.nextInt();
            }
            id = new int[n];
            double re = 0;
            for (int i = 0; i < n; ++i) {

                int bd = i;
                for (int j = 0; j < n; ++j) {
                    id[j] = bd;
                    bd++;
                    bd %= n;
                }
                re = Math.max(re, rec(0, n - 1, 0));
                //re = Math.max(re, rec(lp,1));
            }
            out.println(String.format("%.30f", re));
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public static boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}