#include <bits/stdc++.h>
using namespace std;
const int M = 5e3 + 5;
int R() {
  int x = 0, flag = 1;
  char c;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') flag = -1;
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  return x * flag;
}
int n, x[M], y[M];
double ans, dp[2][M][2];
int main() {
  n = R();
  for (int i = 1; i <= n; i++) {
    x[i] = x[i + n] = R();
    y[i] = y[i + n] = R();
  }
  for (int len = 1; len < n; len++)
    for (int i = 1; i + len <= 2 * n; i++) {
      int j = i + len;
      dp[len & 1][i][0] =
          max(dp[!(len & 1)][i + 1][0] +
                  (sqrt(1ll * (x[i + 1] - x[i]) * (x[i + 1] - x[i]) +
                        1ll * (y[i + 1] - y[i]) * (y[i + 1] - y[i]))),
              dp[!(len & 1)][i + 1][1] +
                  (sqrt(1ll * (x[j] - x[i]) * (x[j] - x[i]) +
                        1ll * (y[j] - y[i]) * (y[j] - y[i]))));
      dp[len & 1][i][1] = max(
          dp[!(len & 1)][i][0] + (sqrt(1ll * (x[i] - x[j]) * (x[i] - x[j]) +
                                       1ll * (y[i] - y[j]) * (y[i] - y[j]))),
          dp[!(len & 1)][i][1] +
              (sqrt(1ll * (x[j - 1] - x[j]) * (x[j - 1] - x[j]) +
                    1ll * (y[j - 1] - y[j]) * (y[j - 1] - y[j]))));
    }
  for (int i = 1; i <= n; i++)
    ans = max(ans, max(dp[(n - 1) & 1][i][0], dp[(n - 1) & 1][i][1]));
  printf("%.10lf\n", ans);
}
