#include <bits/stdc++.h>
using namespace std;
int a[4005], b[4005];
int main() {
  int n;
  scanf("%d", &n);
  double x;
  int i;
  for (i = 0; i < 2 * n; i++) {
    cin >> x;
    int z = (int)(x * 1000 + 0.5);
    a[i] = z % 1000;
  }
  int sum = 0;
  for (i = 0; i < 2 * n; i++) sum += a[i];
  for (i = 0; i < 2 * n; i++) b[i] = ((a[i] == 0) ? 0 : 1000);
  sort(b, b + 2 * n);
  int lo, hi;
  lo = hi = 0;
  for (i = 0; i < n; i++) {
    lo += b[i];
    hi += b[n + i];
  }
  int ans = 1 << 30;
  for (i = lo; i <= hi; i += 1000) ans = min(ans, abs(i - sum));
  printf("%.3f\n", ans / 1000.0);
}
