#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;
}
