#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
double t;
int i, j, k, n, a[5001], ans, s, b[5001], tmp, sum[5001];
bool cmp(int a, int b) { return a > b; }
int main() {
  scanf("%d", &n);
  n *= 2;
  ans = inf;
  for (i = 1; i <= n; i++)
    scanf("%lf", &t), a[i] = (int)((t + 1e-8) * 1000 - floor(t) * 1000);
  for (i = 1, b[0] = s = 0; i <= n; i++)
    if (!a[i])
      s++;
    else
      b[++b[0]] = a[i];
  for (sum[0] = 0, i = 1; i <= b[0]; i++) sum[i] = sum[i - 1] + b[i];
  k = max(0, n / 2 - s);
  for (i = k; i <= b[0] - k; i++)
    ans = min(ans, abs(-sum[i] + 1000 * (b[0] - i) - (sum[b[0]] - sum[i])));
  printf("%.3lf\n", (double)ans / 1000);
  return 0;
}
