#include <bits/stdc++.h>
using namespace std;
double t[4005][4005], co[4005];
int main() {
  int n, a, b, c;
  double x, y, z;
  scanf("%d", &n);
  for (a = 0; a < 2 * n; a++) {
    scanf("%lf", &x);
    co[a] = x - (int)x;
    for (b = 0; b <= n; b++) t[a][b] = 10000;
  }
  t[0][0] = -co[0];
  if (co[0] == (double)0)
    t[0][1] = 0;
  else
    t[0][1] = (double)1 - co[0];
  for (a = 1; a < 2 * n; a++) {
    for (b = 0; b < n; b++) {
      if (co[a] == 0)
        t[a][b + 1] = t[a - 1][b];
      else
        t[a][b + 1] = t[a - 1][b] + 1 - co[a];
      if (abs(t[a][b]) > abs(t[a - 1][b] - co[a]))
        t[a][b] = t[a - 1][b] - co[a];
    }
    if (abs(t[a][b]) > abs(t[a - 1][b] - co[a])) t[a][b] = t[a - 1][b] - co[a];
  }
  printf("%.3lf", abs(t[2 * n - 1][n]));
  return 0;
}
