#include <bits/stdc++.h>
using namespace std;
const int N = 2005, T = N * 2, INF = (int)1e9;
int n, t, pv[T], nv[T], ps[T], ns[T];
int main() {
  scanf("%d", &n);
  t = n * 2;
  int ccnt = 0, ocnt = 0;
  for (int i = 1; i <= t; i++) {
    int a;
    scanf("%*d.%d", &a);
    if (a > 0) {
      ++ccnt;
      pv[ccnt] = 1000 - a;
      nv[ccnt] = -a;
    } else
      ++ocnt;
  }
  for (int i = 1; i <= ccnt; i++) {
    ps[i] = ps[i - 1] + pv[i];
    ns[i] = ns[i - 1] + nv[i];
  }
  int ans = INF;
  for (int i = 0; i <= ccnt && i <= n; i++) {
    if (i + ocnt < n) continue;
    ans = min(ans, abs(ps[i] + ns[ccnt] - ns[i]));
  }
  int a1 = ans / 1000, a2 = ans % 1000;
  printf("%d.%03d\n", a1, a2);
}
