#include <bits/stdc++.h>
using namespace std;
const int N = 4003;
long long a[N], dp[N][N];
long long c(long long x) { return x / 1000 * 1000 + 1000 * (x % 1000 > 0); }
long long f(long long x) { return x / 1000 * 1000; }
int main() {
  int n;
  scanf("%d", &n);
  n += n;
  for (int i = 0; i < n; ++i) {
    int x, y;
    scanf("%d.%d", &x, &y);
    a[i] = x * 1000ll + y;
  }
  memset(dp, 0x3f, sizeof dp);
  dp[n][n / 2] = 0;
  for (int i = n - 1; i >= 0; --i) {
    for (int j = n / 2; j >= 0; --j) {
      if (abs(dp[i + 1][j + 1] + c(a[i]) - a[i]) <
          abs(dp[i + 1][j] + f(a[i]) - a[i])) {
        dp[i][j] = dp[i + 1][j + 1] + c(a[i]) - a[i];
      } else {
        dp[i][j] = dp[i + 1][j] + f(a[i]) - a[i];
      }
    }
  }
  dp[0][0] = abs(dp[0][0]);
  printf("%d.%03d\n", int(dp[0][0] / 1000), int(dp[0][0] % 1000));
}
