#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10;
int a[N], n;
double x;
int main() {
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    scanf("%lf", &x);
    a[i] = int((x + (5e-4)) * 1000) % 1000;
  }
  sort(a, a + 2 * n);
  int ans = 0;
  int p = 0, cnt = 0;
  while (p < 2 * n && a[p] == 0) p++;
  for (int i = p; i < 2 * n;) {
    if (p > 0) {
      ans -= a[i];
      cnt++;
      i++;
      p--;
    } else {
      ans += 1000 - a[i] - a[i + 1];
      i += 2;
    }
  }
  int res = abs(ans);
  for (int i = 0; i < cnt; i++) {
    ans += 1000;
    res = min(res, abs(ans));
  }
  printf("%.3lf", 1.0 * res / 1000);
  return 0;
}
