#include <bits/stdc++.h>
using namespace std;
double dp[4004][2001];
int main() {
  int n;
  cin >> n;
  double a[4001], x[4003], y[4003];
  int m = 2 * n;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    x[i] = a[i] - ceil(a[i]);
    y[i] = a[i] - floor(a[i]);
  }
  dp[0][1] = x[0];
  dp[0][0] = y[0];
  for (int i = 1; i < m; i++) {
    dp[i][0] = dp[i - 1][0] + y[i];
    for (int g = 1; g < min(i + 2, n + 1); g++) {
      if (abs(dp[i - 1][g - 1] + x[i]) < abs(dp[i - 1][g] + y[i]))
        dp[i][g] = dp[i - 1][g - 1] + x[i];
      else
        dp[i][g] = dp[i - 1][g] + y[i];
    }
    dp[i][i + 1] = dp[i - 1][i] + x[i];
  }
  printf("%.3lf", abs(dp[m - 1][n]));
  return 0;
}
