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;
using LL = long long;
template <typename T>
using V = vector<T>;
template <typename T, typename S>
using P = pair<T, S>;
template <class T>
using min_heap = priority_queue<T, std::vector<T>, std::greater<T>>;
using LD = long double;
template <typename T, typename S>
void check(T& a, S& b) {
  if (a >= b) {
    a %= b;
  }
}
template <typename T>
T gcd(T u, T v) {
  if (u == v) return u;
  if (u == 0) return v;
  if (v == 0) return u;
  if (~u & 1) {
    if (v & 1)
      return gcd(u >> 1, v);
    else
      return gcd(u >> 1, v >> 1) << 1;
  }
  if (~v & 1) return gcd(u, v >> 1);
  if (u > v) return gcd((u - v) >> 1, v);
  return gcd((v - u) >> 1, u);
}
const int N = 2501;
long double dp[N][N][2];
int vis[N][N][2];
LL sqr(LL a) { return a * a; }
long double dist(P<int, int>& a, P<int, int>& b) {
  return sqrt(sqr(a.first - b.first) + sqr(a.second - b.second));
}
V<P<int, int>> points;
int n;
long double solve(int i, int j, int k) {
  auto& Vis = vis[i][j][k];
  if (Vis) return dp[i][j][k];
  Vis = 1;
  auto& ans = dp[i][j][k] = 0;
  if (!k) {
    int next = (i + 1) % n, prev = (j - 1 + n) % n;
    if (next == j) return 0;
    ans = max(solve(next, j, 0) + dist(points[next], points[i]),
              solve(prev, i, 1) + dist(points[prev], points[i]));
  } else {
    int next = (i - 1 + n) % n, prev = (j + 1) % n;
    if (next == j) return 0;
    ans = max(solve(next, j, 1) + dist(points[next], points[i]),
              solve(prev, i, 0) + dist(points[prev], points[i]));
  }
  return ans;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cerr.tie(NULL);
  ;
  cout << fixed << setprecision(10);
  cerr << fixed << setprecision(10);
  cin >> n;
  points.resize(n);
  for (int i = 0; i < (int)n; i++) {
    cin >> points[i].first >> points[i].second;
  }
  long double ans = 0;
  for (int i = 0; i < (int)n; i++) {
    ans = max(ans,
              solve((i + 1) % n, i, 0) + dist(points[i], points[(i + 1) % n]));
    ans = max(ans,
              solve(i, (i + 1) % n, 1) + dist(points[i], points[(i + 1) % n]));
  }
  cout << ans << '\n';
  cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms"
       << '\n';
  return 0;
}