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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
struct Point {
  double x, y;
  Point() {}
  Point(double x, double y) : x(x), y(y) {}
  double abs() const { return hypot(x, y); }
  double arg() const { return atan2(y, x); }
  Point operator*(double o) const { return Point(x * o, y * o); }
  Point operator+(const Point &o) const { return Point(x + o.x, y + o.y); }
  Point operator-(const Point &o) const { return Point(x - o.x, y - o.y); }
  bool operator<(const Point &o) const {
    return x < o.x - 1e-9 || (x < o.x + 1e-9 && y < o.y - 1e-9);
  }
  friend bool operator==(const Point &r1, const Point &r2) {
    return r1.x == r2.x && r1.y == r2.y;
  }
  Point scale(double o) const { return *this * (o / abs()); }
  Point rotY() const { return Point(-y, x); }
  Point rotX() const { return Point(y, -x); }
  double cross(Point b) const { return x * b.y - b.x * y; }
  double dot(Point b) const { return x * b.x + y * b.y; }
  double disToSeg(Point &a, Point &b) {
    return fabs(((*this) - a).cross(b - a) / (b - a).abs());
  }
  void readin() { scanf("%lf%lf", &x, &y); }
} p[2505];
double dp[2505][2505][2];
double dis[2505][2505];
void fmain(int tid) {
  scanf("%d", &n);
  for (int(i) = 0; (i) < (int)(n); (i)++) p[i].readin();
  double ans = 0;
  for (int(i) = 0; (i) < (int)(n); (i)++)
    for (int j = i + 1; j < n; j++) dis[i][j] = (p[i] - p[j]).abs();
  for (int len = 1; len < n; len++) {
    for (int i = 0; i < n; i++) {
      int j = (i + len) % n;
      int F = (i + 1 + n) % n;
      dp[i][j][1] = max({dp[i][j][1], dp[F][j][1] + dis[min(i, F)][max(i, F)],
                         dis[min(i, j)][max(i, j)] + dp[j][F][0]});
      j = (i - len + n) % n;
      F = (i - 1 + n) % n;
      dp[i][j][0] = max({dp[i][j][0], dp[F][j][0] + dis[min(i, F)][max(i, F)],
                         dis[min(i, j)][max(i, j)] + dp[j][F][1]});
      if (len == n - 1) {
        ans = max({ans, dp[i][j][0], dp[i][j][1]});
      }
    }
  }
  printf("%.15lf\n", ans);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}