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;
int n;
long double dp[2519][2519][2];
pair<long double, long double> pt[2519];
int md(int a, int m) {
  if (a < 0) a += m;
  return a % m;
}
long double dist(int a, int b) {
  return sqrt((pt[a].first - pt[b].first) * (pt[a].first - pt[b].first) +
              (pt[a].second - pt[b].second) * (pt[a].second - pt[b].second));
}
long double max(long double a, long double b, long double c) {
  return max(a, max(b, c));
}
long double dpf(int l, int r, int t2) {
  if (dp[l][r][t2] != 0.0) return dp[l][r][t2];
  if (abs(l - r) <= 1 || abs(r - l) >= n - 1) return 0.0;
  long double ans = 0;
  int pt, npt;
  if (t2 == 0)
    pt = min(l, r), npt = max(l, r);
  else
    pt = max(l, r), npt = min(l, r);
  if (l < r) {
    if (pt == l) {
      ans = max(ans, dpf(pt, md(npt - 1, n), (pt < md(npt - 1, n)) ? 0 : 1));
      ans = max(ans, dpf(md(pt + 1, n), npt, (md(pt + 1, n) < npt) ? 0 : 1) +
                         dist(pt, md(pt + 1, n)));
      ans = max(ans, dpf(pt, md(npt - 1, n), (pt < md(npt - 1, n)) ? 1 : 0) +
                         dist(pt, md(npt - 1, n)));
    } else {
      ans = max(ans, dpf(npt, md(pt - 1, n), (npt < md(pt - 1, n)) ? 1 : 0) +
                         dist(pt, md(pt - 1, n)));
      ans = max(ans, dpf(md(npt + 1, n), pt, (md(npt + 1, n) < pt) ? 1 : 0));
      ans = max(ans, dpf(md(npt + 1, n), pt, (md(npt + 1, n) < pt) ? 0 : 1) +
                         dist(md(npt + 1, n), pt));
    }
  } else {
    if (pt == l) {
      ans = max(ans, dpf(pt, md(npt - 1, n), (pt < md(npt - 1, n)) ? 0 : 1));
      ans = max(ans, dpf(md(pt + 1, n), npt, (md(pt + 1, n) < npt) ? 0 : 1) +
                         dist(pt, md(pt + 1, n)));
      ans = max(ans, dpf(pt, md(npt - 1, n), (pt < md(npt - 1, n)) ? 1 : 0) +
                         dist(pt, md(npt - 1, n)));
    } else {
      ans = max(ans, dpf(npt, md(pt - 1, n), (npt < md(pt - 1, n)) ? 1 : 0) +
                         dist(pt, md(pt - 1, n)));
      ans = max(ans, dpf(md(npt + 1, n), pt, (md(npt + 1, n) < pt) ? 1 : 0));
      ans = max(ans, dpf(md(npt + 1, n), pt, (md(npt + 1, n) < pt) ? 0 : 1) +
                         dist(md(npt + 1, n), pt));
    }
  }
  return dp[l][r][t2] = ans;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pt[i].first >> pt[i].second;
  }
  if (n == 2) {
    cout << fixed << setprecision(12) << dist(0, 1) << endl;
    return 0;
  }
  if (n == 3) {
    cout << fixed << setprecision(12)
         << max(dist(0, 1) + dist(1, 2), dist(0, 2) + dist(2, 1),
                dist(1, 0) + dist(0, 2))
         << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    dp[i][md(i + 1, n)][0] = dp[i][md(i + 1, n)][1] = 0;
  }
  long double ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i == j) continue;
      if (dp[i][j][0] == 0.0) dp[i][j][0] = dpf(i, j, 0);
      if (dp[j][i][1] == 0.0) dp[j][i][1] = dpf(j, i, 1);
      if (dp[i][j][1] == 0.0) dp[i][j][1] = dpf(i, j, 1);
      if (dp[j][i][0] == 0.0) dp[j][i][0] = dpf(j, i, 0);
      ans = max(ans, dp[i][j][0] + dp[j][i][1] + dist(i, j));
      ans = max(ans, dp[i][j][1] + dp[j][i][0] + dist(i, j));
    }
  }
  cout << fixed << setprecision(12) << ans << endl;
  return 0;
}