#include <bits/stdc++.h>
using namespace std;
const int maxn = 5001;
long long a[maxn], dp[maxn][maxn];
long long n;
long long solve(long long i, long long f) {
  if (f > n) return 1e12;
  if (i == 2 * n) {
    if (f == n) return 0;
    return 1e12;
  }
  long long &ret = dp[i][f];
  if (ret != 1e9) return ret;
  long long x = 0, y = 0;
  x = solve(i + 1, f + 1) - a[i];
  y = solve(i + 1, f) + (1000 - a[i]) % 1000;
  return ret = (abs(x) < abs(y) ? x : y);
}
signed main() {
  scanf("%d", &n);
  for (long long i = 0; i < 2 * n; ++i) scanf("%d.%d", a + i, a + i);
  for (long long i = 0; i < 2 * n; ++i)
    for (long long j = 0; j <= n; ++j) dp[i][j] = 1e9;
  printf("%.3lf\n", abs(solve(0, 0)) / 1000.0);
  return 0;
}
