#include <bits/stdc++.h>
using namespace std;
const int MX = 4000;
const int oo = 1e8;
int A[MX];
int N, N2;
int dp[MX][2001];
int f(int x, int lft) {
  if (lft < 0) {
    return oo;
  }
  if (x == N2) {
    if (lft == 0) {
      return 0;
    } else {
      return oo;
    }
  }
  if (dp[x][lft] != -1) {
    return dp[x][lft];
  }
  int a = f(x + 1, lft - 1) + A[x];
  int b = f(x + 1, lft) - ((1000 - A[x]) % 1000);
  int ans = abs(a) < abs(b) ? a : b;
  return dp[x][lft] = ans;
}
int main() {
  scanf("%d", &N);
  N2 = N << 1;
  int tmp;
  for (int i = 0; i < N2; i++) {
    scanf("%d.%d", &tmp, &A[i]);
  }
  memset(dp, -1, sizeof(dp));
  int ans_i = f(0, N);
  double ans = abs(ans_i);
  ans /= 1000.0;
  printf("%.3lf\n", ans);
}
