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 long long max4 = 10004;
const long long maxx = 2505;
const long long max6 = 1000006;
const long long max7 = 10000007;
const long long lg4 = 13;
const long long lg5 = 17;
const long long lg6 = 20;
const long long INF = 2LL * 1000000000;
long long powmod(long long a, long long b, long long mod) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
  }
  return res;
}
long long gcd(long long a, long long b) {
  while (b > 0) {
    long long t = a % b;
    a = b, b = t;
  }
  return a;
}
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
long long is_prime(long long n) {
  if (n <= 1 || n > 3 && (n % 2 == 0 || n % 3 == 0)) return 0;
  for (long long i = 5, t = 2; i * i <= n; i += t, t = 6 - t)
    if (n % i == 0) return 0;
  return 1;
}
long long x[maxx], y[maxx];
long double dp[maxx][maxx][2];
long double dis(long long x1, long long y1, long long x2, long long y2) {
  return sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  ;
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) cin >> x[i] >> y[i];
  long double res = 0.0;
  for (long long len = 1; len <= n - 1; len++)
    for (long long i = 1; i <= n; i++) {
      long long j = (i + len) % n;
      if (j == 0) j = n;
      if (len == 1) {
        dp[i][j][0] = dp[i][j][1] = dis(x[i], y[i], x[j], y[j]);
        continue;
      }
      long long ii = (i + 1) % n, jj = (j + n - 1) % n;
      if (ii == 0) ii = n;
      if (jj == 0) jj = n;
      dp[i][j][0] = max(dis(x[i], y[i], x[ii], y[ii]) + dp[ii][j][0],
                        dis(x[i], y[i], x[j], y[j]) + dp[ii][j][1]);
      dp[i][j][1] = max(dis(x[j], y[j], x[jj], y[jj]) + dp[i][jj][1],
                        dis(x[j], y[j], x[i], y[i]) + dp[i][jj][0]);
      if (len == n - 1) res = max(res, max(dp[i][j][0], dp[i][j][1]));
    }
  cout << fixed << setprecision(20) << res << endl;
  return 0;
}