#include <bits/stdc++.h>
using namespace std;
const int MAXN = 4020;
int a[MAXN];
int calc(int left, int right) {
  int ret = 0;
  while (left <= right) {
    if (!a[left] || !a[right]) {
      ret += min(a[left] + a[right], 1000 - a[left] - a[right]);
    } else {
      ret += 1000 - a[left] - a[right];
    }
    ++left;
    --right;
  }
  return ret;
}
int sum(int left, int right) {
  int sum = 0;
  for (int i = left; i <= right; ++i) {
    sum += a[i];
  }
  return sum;
}
int main(int argc, char **argv) {
  int n;
  scanf("%d", &n);
  n <<= 1;
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    int r, c;
    scanf("%d.%d", &r, &c);
    a[i] = c;
    sum += c;
  }
  sort(a, a + n);
  int total = 500 * n;
  int ans = total - sum;
  if (ans < 0) ans = -ans;
  for (int i = 0; 2 * i < n; ++i) {
    if (!a[i]) {
      int cur = total - sum - 1000 * (i + 1);
      if (cur < 0) {
        cur = -cur;
      }
      ans = min(ans, cur);
    }
  }
  printf("%d.%03d\n", ans / 1000, ans % 1000);
  return 0;
}
