#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
 
int main() {
  double ans = 0;
  int count = 0;
  int N;
  cin >> N;
  vector<pair<int, int>> points;
  for(int i=0;i<N;i++){
    pair<int, int> p;
    cin >> p.first;
    cin >> p.second;
    points.push_back(p);
  }
  sort(points.begin(), points.end());
  do{
    int sx = points[0].first;
    int sy = points[0].second;
    for(int i=1; i<N; i++){
      ans += sqrt(pow((sx-points[i].first), 2) + pow((sy-points[i].second), 2));
      sx = points[i].first;
      sy = points[i].second;
    }
    count++;
  }while(next_permutation(points.begin(), points.end()));
  cout << setprecision(10) << (double)ans/count << endl;
  return 0;
}
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#define my_abs(x) ((x) < 0 ? -(x) : (x))
using namespace std; 
typedef long long ll; 
ll ans, fact[25]; 
int arr[25]; 
inline void chk(int len)
{
	ll res = 9 - my_abs(arr[0]); 
	for (int i = 1; i <= len - 1 >> 1; i++)
		res *= 10 - my_abs(arr[i]); 
	ans += res; 
}
void dfs(int cur, int len, ll rem)
{
	if (cur == len >> 1)
	{
		if (!rem)
		{
			arr[cur] = 0; 
			chk(len); 
		}
		return; 
	}
	ll diff = fact[len - cur - 1] - fact[cur]; 
	ll r = ceil((double)rem / diff), l = floor((double)rem / diff); 
	if (-9 <= r && r <= 9)
	{
		arr[cur] = r; 
		dfs(cur + 1, len, rem - diff * r); 
	}
	if (l != r && -9 <= l && l <= 9)
	{
		arr[cur] = l; 
		dfs(cur + 1, len, rem - diff * l); 
	}
}
int main()
{
	// freopen("ARC075-F.in", "r", stdin); 
	ll d;
	scanf("%lld", &d); 
	fact[0] = 1; 
	for (int i = 1; i <= 18; i++)
		fact[i] = fact[i - 1] * 10; 
	for (int cnt = 1; cnt <= 18; cnt++)
	{
		memset(arr, 0, sizeof(arr)); 
		dfs(0, cnt, d);
	}
	printf("%lld\n", ans);
	return 0; 
}
