#include <bits/stdc++.h>
using namespace std;
const int SIZE = 10 << 10;
int n;
int arr[SIZE];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 2 * n; i++) {
    double q;
    scanf("%lf", &q);
    q *= 1000.0;
    int iq = int(q + 0.5);
    arr[i] = iq % 1000;
  }
  int sum = 0;
  for (int i = 0; i < 2 * n; i++) sum += arr[i];
  int nonint = 0;
  for (int i = 0; i < 2 * n; i++) nonint += (arr[i] != 0);
  ((void)0);
  ((void)0);
  int ans = 1000000000;
  for (int j = max(nonint - n, 0); j <= min(nonint, n); j++) {
    int tdelta = 1000 * j - sum;
    if (ans > abs(tdelta)) ans = abs(tdelta);
  }
  printf("%0.3lf\n", ans / 1000.0);
  return 0;
}
