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;
double f[5005][2505][2];
bool ha[5005][2505][2] = {0};
int n;
bool zk[5005][2505][2];
long long x[2505], y[2505];
int xulie(int x) {
  if (x <= n) return x;
  return x - n;
}
double dis(int i, int jj) {
  return sqrt((double)(x[i] - x[jj]) * (x[i] - x[jj]) +
              (double)(y[i] - y[jj]) * (y[i] - y[jj]));
}
double dfs(int l, int ge, int k) {
  if (ha[l][ge][k]) return f[l][ge][k];
  if (ge == 1) {
    ha[l][ge][k] = 1;
    f[l][ge][k] = 0;
    return 0;
  }
  ha[l][ge][k] = 1;
  double ans = 0;
  int r = l + ge - 1;
  if (k == 0) {
    double hmz = dis(xulie(l), xulie(l + 1)) + dfs(l + 1, ge - 1, 0);
    if (ans < hmz) {
      ans = hmz;
      zk[l][ge][k] = 0;
    }
    hmz = dis(xulie(l), xulie(r)) + dfs(l + 1, ge - 1, 1);
    if (ans < hmz) {
      ans = hmz;
      zk[l][ge][k] = 1;
    }
  } else {
    double hmz = dis(xulie(r), xulie(r - 1)) + dfs(l, ge - 1, 1);
    if (ans < hmz) {
      ans = hmz;
      zk[l][ge][k] = 1;
    }
    hmz = dis(xulie(l), xulie(r)) + dfs(l, ge - 1, 0);
    if (ans < hmz) {
      ans = hmz;
      zk[l][ge][k] = 0;
    }
  }
  f[l][ge][k] = ans;
  return ans;
}
void solve() {
  int i;
  double ans = 0;
  int st;
  int l, ge, k;
  for (i = 1; i <= n; i++) {
    double hmz;
    hmz = dfs(i, n, 0);
    if (hmz > ans) {
      ans = hmz;
      st = i;
      k = 0;
    }
    hmz = dfs(i, n, 1);
    if (hmz > ans) {
      ans = hmz;
      st = i;
      k = 1;
    }
  }
  l = st;
  ge = n;
  ans = 0;
  while (ge != 1) {
    if (k == 0) {
      if (zk[l][ge][k] == 0) {
        ans += dis(xulie(l), xulie(l + 1));
        l = l + 1;
        ge--;
        k = 0;
      } else {
        ans += dis(xulie(l), xulie(l + ge - 1));
        l = l + 1;
        ge--;
        k = 1;
      }
    } else {
      if (zk[l][ge][k] == 0) {
        ans += dis(xulie(l), xulie(l + ge - 1));
        ge--;
        k = 0;
      } else {
        ans += dis(xulie(l + ge - 1), xulie(l + ge - 1 - 1));
        ge--;
        k = 1;
      }
    }
  }
  printf("%.12lf\n", ans);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  solve();
  return 0;
}