#include <bits/stdc++.h>
using namespace std;
int n, a[100010], m;
void input() {
  int i;
  m = 0;
  scanf("%d", &n);
  for (i = 1; i <= 2 * n; i++) {
    double tmp;
    scanf("%lf", &tmp);
    tmp += 0.0005;
    a[i] = tmp * 1000;
    a[i] %= 1000;
    if (a[i]) m++;
  }
}
void solv() {
  int i, sum = 0, l, r, ans = 5000000;
  for (i = 1; i <= 2 * n; i++) sum += a[i];
  r = min(n, m);
  l = max(0, m - n);
  for (i = l; i <= r; i++) {
    int tmp = abs(sum - i * 1000);
    ans = min(ans, tmp);
  }
  printf("%.3lf\n", ((double)(ans) / 1000.000));
}
int main() {
  input();
  solv();
  return 0;
}
