#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2001;
int dp[2 * MAXN][MAXN];
int p[2 * MAXN];
int main() {
  memset(dp, 0, 2 * MAXN * MAXN * sizeof(int));
  int n;
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) {
    int g;
    scanf("%d.%3d", &g, &p[i]);
  }
  for (int i = 1; i <= 2 * n; i++) {
    for (int j = max(0, i - n); j <= min(i, n); j++) {
      if (j == 0) {
        dp[i][j] = dp[i - 1][j] - p[i];
      } else if (abs(dp[i - 1][j] - p[i]) <
                 abs(dp[i - 1][j - 1] + (p[i] == 0 ? 0 : -p[i] + 1000))) {
        dp[i][j] = dp[i - 1][j] - p[i];
      } else {
        dp[i][j] = dp[i - 1][j - 1] + (p[i] == 0 ? 0 : -p[i] + 1000);
      }
    }
    if (i <= n)
      dp[i][min(i, n)] =
          dp[i - 1][min(i, n) - 1] + (p[i] == 0 ? 0 : -p[i] + 1000);
  }
  int answ = dp[2 * n][n];
  if (answ < 0) {
    answ *= -1;
  }
  cout << answ / 1000 << "." << setw(3) << setfill('0') << answ % 1000 << endl;
  return 0;
}
