#include <bits/stdc++.h>
using namespace std;
double f[5005][2505][2];
bool ha[5005][2505][2] = {0};
int n;
bool zk[5005][2505][2];
long long x[2505], y[2505];
int xulie(int x) {
  if (x <= n) return x;
  return x - n;
}
double dis(int i, int jj) {
  return sqrt((double)(x[i] - x[jj]) * (x[i] - x[jj]) +
              (double)(y[i] - y[jj]) * (y[i] - y[jj]));
}
double dfs(int l, int ge, int k) {
  if (ha[l][ge][k]) return f[l][ge][k];
  if (ge == 1) {
    ha[l][ge][k] = 1;
    f[l][ge][k] = 0;
    return 0;
  }
  ha[l][ge][k] = 1;
  double ans = 0;
  int r = l + ge - 1;
  if (k == 0) {
    double hmz = dis(xulie(l), xulie(l + 1)) + dfs(l + 1, ge - 1, 0);
    if (ans < hmz) {
      ans = hmz;
      zk[l][ge][k] = 0;
    }
    hmz = dis(xulie(l), xulie(r)) + dfs(l + 1, ge - 1, 1);
    if (ans < hmz) {
      ans = hmz;
      zk[l][ge][k] = 1;
    }
  } else {
    double hmz = dis(xulie(r), xulie(r - 1)) + dfs(l, ge - 1, 1);
    if (ans < hmz) {
      ans = hmz;
      zk[l][ge][k] = 1;
    }
    hmz = dis(xulie(l), xulie(r)) + dfs(l, ge - 1, 0);
    if (ans < hmz) {
      ans = hmz;
      zk[l][ge][k] = 0;
    }
  }
  f[l][ge][k] = ans;
  return ans;
}
void solve() {
  int i;
  double ans = 0;
  int st;
  int l, ge, k;
  for (i = 1; i <= n; i++) {
    double hmz;
    hmz = dfs(i, n, 0);
    if (hmz > ans) {
      ans = hmz;
      st = i;
      k = 0;
    }
    hmz = dfs(i, n, 1);
    if (hmz > ans) {
      ans = hmz;
      st = i;
      k = 1;
    }
  }
  l = st;
  ge = n;
  ans = 0;
  while (ge != 1) {
    if (k == 0) {
      if (zk[l][ge][k] == 0) {
        ans += dis(xulie(l), xulie(l + 1));
        l = l + 1;
        ge--;
        k = 0;
      } else {
        ans += dis(xulie(l), xulie(l + ge - 1));
        l = l + 1;
        ge--;
        k = 1;
      }
    } else {
      if (zk[l][ge][k] == 0) {
        ans += dis(xulie(l), xulie(l + ge - 1));
        ge--;
        k = 0;
      } else {
        ans += dis(xulie(l + ge - 1), xulie(l + ge - 1 - 1));
        ge--;
        k = 1;
      }
    }
  }
  printf("%.12lf\n", ans);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  solve();
  return 0;
}
