#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 100000 + 10;
int n;
int a, sum, ans, x, cnt;
int main() {
  while (scanf("%d", &n) == 1) {
    n *= 2;
    cnt = 0;
    sum = 0;
    for (int i = 0; i < n; i++) {
      scanf("%d.%d", &x, &a);
      if (a == 0) cnt++;
      sum -= a;
    }
    int ans = inf;
    for (int i = max(n / 2 - cnt, 0); i <= n / 2; i++) {
      ans = min(ans, abs(i * 1000 + sum));
    }
    printf("%.3f\n", (double)ans / 1000);
  }
  return 0;
}
