#include <bits/stdc++.h>
using namespace std;
const int N = 4e3 + 3;
int n;
double dp[N][N], e[N];
int main() {
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    double a;
    cin >> a;
    e[i] = a - floor(a);
  }
  for (int i = 0; i < n; i++) dp[2 * n][i] = 2e9;
  for (int i = n + 1; i <= 2 * n; i++) dp[2 * n][i] = 2e9;
  for (int i = 2 * n - 1; i > -1; i--) {
    for (int prev = 0; prev <= n; prev++) {
      double ch1 = 2e9, ch2 = 2e9;
      if (prev < n) {
        if (e[i])
          ch1 = dp[i + 1][prev + 1] + (e[i] - 1.0);
        else
          ch1 = dp[i + 1][prev + 1];
      }
      if (i - prev < n) ch2 = dp[i + 1][prev] + e[i];
      if (abs(ch1) < abs(ch2))
        dp[i][prev] = ch1;
      else
        dp[i][prev] = ch2;
    }
  }
  cout << fixed << setprecision(3) << abs(dp[0][0]);
}
