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;
void read(long long &first) {
  first = 0;
  long long f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    first = (first << 1) + (first << 3) + c - '0';
    c = getchar();
  }
  first *= f;
  return;
}
long long fs(long long first) { return first < 0 ? -first : first; }
void print(long long first) {
  if (first < 10) {
    putchar(first + '0');
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
  return;
}
void write(long long first) {
  if (first < 0) {
    putchar('-');
    first = fs(first);
  }
  print(first);
  return;
}
pair<double, double> s[2550];
long long n;
double dp1[2550][2550], dp2[2550][2550];
double dist(int a, int b) {
  return sqrt((s[a].first - s[b].first) * (s[a].first - s[b].first) +
              (s[a].second - s[b].second) * (s[a].second - s[b].second));
}
int main() {
  read(n);
  for (int i = 0; i < n; i++) scanf("%lf %lf", &s[i].first, &s[i].second);
  for (int len = 2; len <= n; len++)
    for (int l = 0; l < n; l++) {
      int r = (l + len - 1) % n;
      dp1[l][r] = max(dp1[(l + 1) % n][r] + dist(l, (l + 1) % n),
                      dp2[(l + 1) % n][r] + dist(l, r));
      dp2[l][r] = max(dp2[l][(r - 1 + n) % n] + dist((r - 1 + n) % n, r),
                      dp1[l][(r - 1 + n) % n] + dist(l, r));
    }
  double ans = 0;
  for (int i = 0; i < n; i++)
    ans = max(ans, max(dp1[i][(i + n - 1) % n], dp2[i][(i + n - 1) % n]));
  printf("%.10lf", ans);
  return 0;
}