#include <bits/stdc++.h>
using namespace std;
int a[4003];
int dp[4003][2003];
int n;
int modul(int x) {
  if (x < 0) return -x;
  return x;
}
int main() {
  scanf("%d", &n);
  int i, j;
  int sum = 0;
  int x;
  for (i = 0; i < 2 * n; i++) {
    scanf("%d.%d", &x, &a[i + 1]);
    sum += a[i + 1];
  }
  for (i = 0; i <= 2 * n; i++)
    for (j = 0; j <= n; j++) dp[i][j] = 2000000000;
  dp[0][0] = 0;
  for (i = 1; i <= 2 * n; i++)
    for (j = 0; j <= i; j++) {
      if (j == 0)
        dp[i][j] = dp[i - 1][j] - a[i];
      else if (a[i] > 0) {
        if (modul(dp[i - 1][j] - a[i]) < modul(dp[i - 1][j - 1] + 1000 - a[i]))
          dp[i][j] = dp[i - 1][j] - a[i];
        else
          dp[i][j] = dp[i - 1][j - 1] + 1000 - a[i];
      } else {
        if (modul(dp[i - 1][j]) < modul(dp[i - 1][j - 1]))
          dp[i][j] = dp[i - 1][j];
        else
          dp[i][j] = dp[i - 1][j - 1];
      }
    }
  dp[2 * n][n] = modul(dp[2 * n][n]);
  printf("%d.%d%d%d\n", dp[2 * n][n] / 1000, (dp[2 * n][n] % 1000) / 100,
         (dp[2 * n][n] % 100) / 10, dp[2 * n][n] % 10);
  return 0;
}
