#include <bits/stdc++.h>
using namespace std;
int abs(int a) { return a > 0 ? a : -a; }
int main() {
  int n, N;
  while (~scanf("%d", &n)) {
    N = n << 1;
    int i, j, t, sum = 0, zero = 0;
    for (i = 0; i < N; i++) {
      scanf("%*d.%d", &t);
      sum -= t;
      zero += (t == 0);
    }
    sum += 1000 * n;
    int mi = max(0, zero - n), ma = min(zero, n);
    int ans = 1000000000;
    for (int i = mi; i <= ma; i++) {
      ans = min(ans, abs(sum - i * 1000));
    }
    printf("%.3f\n", ans / 1000.0);
  }
}
