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;
const int Maxk = 1005;
string mul(string a, string b) {
  int res[Maxk];
  memset(res, 0, sizeof(res));
  reverse(a.begin(), a.end());
  reverse(b.begin(), b.end());
  for (int i = 0; i < a.length(); i++) {
    for (int j = 0; j < b.length(); j++) {
      res[i + j] += (a[i] - '0') * (b[j] - '0');
    }
  }
  for (int i = 0; i < Maxk; i++) {
    if (res[i] >= 10) {
      res[i + 1] += (res[i] / 10);
      res[i] %= 10;
    }
  }
  string ret;
  bool flag = false;
  for (int i = Maxk - 1; i >= 0; i--) {
    if (flag || res[i]) {
      flag = true;
      ret = ret + (char)(res[i] + '0');
    }
  }
  if (ret == "") ret = "0";
  return ret;
}
string add(string a, string b) {
  if (a.length() < b.length()) swap(a, b);
  while (a.length() != b.length()) {
    b = '0' + b;
  }
  for (int i = a.length() - 1; i >= 0; i--) {
    a[i] += (b[i] - '0');
    if (a[i] > '9' && i) {
      a[i] -= 10;
      a[i - 1]++;
    }
  }
  if (a[0] > '9') {
    a[0] -= 10;
    a = '1' + a;
  }
  return a;
}
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
const int Maxn = 2505;
double x[Maxn], y[Maxn];
double dp[Maxn][Maxn][2];
int n;
double dist(int a, int b) {
  if (a > n) a -= n;
  if (a <= 0) a += n;
  if (b > n) b -= n;
  if (b <= 0) b += n;
  return sqrt((double)(x[a] - x[b]) * (x[a] - x[b]) +
              (double)(y[a] - y[b]) * (y[a] - y[b]));
}
double f(int a, int b, int c) {
  if (a > n) a -= n;
  if (a <= 0) a += n;
  if (b > n) b -= n;
  if (b <= 0) b += n;
  return dp[a][b][c];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int t1, t2;
    scanf("%d %d", &t1, &t2);
    x[i] = (double)t1;
    y[i] = (double)t2;
  }
  for (int i = 1; i <= n; i++) {
    dp[i][i][0] = 0.0;
    dp[i][i][1] = 0.0;
  }
  double ans = 0.0;
  for (int len = 2; len <= n; len++) {
    for (int i = 1; i <= n; i++) {
      int j = i + len - 1;
      if (j > n) j -= n;
      dp[i][j][0] =
          max(f(i + 1, j, 0) + dist(i, i + 1), f(i + 1, j, 1) + dist(i, j));
      dp[i][j][1] =
          max(f(i, j - 1, 0) + dist(i, j), f(i, j - 1, 1) + dist(j, j - 1));
      if (len == n) {
        ans = max(ans, dp[i][j][0]);
        ans = max(ans, dp[i][j][1]);
      }
    }
  }
  printf("%.13lf\n", ans);
  return 0;
}