#include <bits/stdc++.h>
using namespace std;
double d[2505][2505], f[2505][2505][2], ans;
long long x[2505], y[2505];
int t[5005], n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) t[i] = t[i + n] = t[i + n + n] = i;
  for (int i = 1; i <= n; i++) scanf("%I64d%I64d", x + i, y + i);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j < i; j++) {
      double dx = x[i] - x[j], dy = y[i] - y[j];
      d[i][j] = d[j][i] = sqrt(dx * dx + dy * dy);
    }
  }
  for (int i = 1; i <= n; i++)
    f[i][t[i + 1]][0] = f[i][t[i + 1]][1] = d[i][t[i + 1]];
  for (int l = 2; l <= n - 1; l++) {
    for (int i = 1; i <= n; i++) {
      f[i][t[i + l]][0] =
          d[i][t[i + l]] +
          max(f[t[i + 1]][t[i + l]][1],
              d[t[i + l - 1]][t[i + l]] + f[t[i + 1]][t[i + l - 1]][1]);
      f[i][t[i + l]][1] =
          d[i][t[i + l]] + max(f[i][t[i + l - 1]][0],
                               d[i][t[i + 1]] + f[t[i + 1]][t[i + l - 1]][0]);
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) ans = max(ans, max(f[i][j][0], f[i][j][1]));
  }
  printf("%.10lf\n", ans);
  return 0;
}
