#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e8;
int dp[4007][2001];
int N, temp, ar[4007];
int solve(int n, int f) {
  if (f > N) return INF;
  if (n > 2 * N - 1) {
    if (f == N) return 0;
    return INF;
  }
  int &ret = dp[n][f];
  if (ret != -1) return ret;
  int ret1 = solve(n + 1, f + 1) + ar[n];
  int ret2 = solve(n + 1, f) - (1000 - ar[n]) % 1000;
  if (((ret1) > 0 ? (ret1) : (-(ret1))) < ((ret2) > 0 ? (ret2) : (-(ret2))))
    return ret = ret1;
  else
    return ret = ret2;
}
int main() {
  cin >> N;
  for (int i = 0; i < 2 * N; i++) {
    scanf("%d.%d", &temp, &ar[i]);
  }
  memset(dp, -1, sizeof dp);
  int X = solve(0, 0);
  X = ((X) > 0 ? (X) : (-(X)));
  double answer = (double)X / 1000.0;
  printf("%.3lf", fabs(answer));
  return 0;
}
