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;
inline long long read() {
  long long f = 1, x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + (s - '0');
    s = getchar();
  }
  return x * f;
}
const int jzm = 998244353;
inline int ABS(int x) { return x < 0 ? -x : x; }
int n, m, i, j, s, o, k;
double x[2505], y[2505];
inline double dis(double a, double b, double s, double o) {
  return sqrt((a - s) * (a - s) + (b - o) * (b - o));
}
double dp[2505][2505][2];
int ll(int x) { return x - 1 < 1 ? n : x - 1; }
int rr(int x) { return x % n + 1; }
double DIS(int a, int b) { return dis(x[a], y[a], x[b], y[b]); }
double DP(int l, int r, int f) {
  if (l == r) return 0.0;
  if (dp[l][r][f] >= 0.0) return dp[l][r][f];
  if (l == ll(r)) return dp[l][r][f] = dis(x[l], y[l], x[r], y[r]);
  if (!f) {
    dp[l][r][f] =
        max(DP(rr(l), r, 0) + DIS(l, rr(l)), DP(rr(l), r, 1) + DIS(l, r));
  } else
    dp[l][r][f] =
        max(DP(l, ll(r), 1) + DIS(ll(r), r), DP(l, ll(r), 0) + DIS(l, r));
  return dp[l][r][f];
}
int main() {
  n = read();
  memset(dp, -1, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    x[i] = (double)read();
    y[i] = (double)read();
  }
  double ans = 0.0;
  int l = 0, r = n - 1;
  for (int i = 1; i <= n; i++) {
    l = rr(l);
    r = rr(r);
    ans = max(ans, max(DP(l, r, 0), DP(l, r, 1)));
  }
  printf("%.10lf\n", ans);
  return 0;
}