#include <bits/stdc++.h>
int Abs(int x) { return x < 0 ? -x : x; }
int main() {
  int i, N, ans = 0, sum = 0, c = 0, d = 0;
  double p;
  scanf("%d", &N);
  for (i = 0; i < 2 * N; i++) {
    scanf("%lf", &p);
    int t = ((int)(p * 1000 + 0.1)) % 1000;
    if (!t) c++;
    sum += t;
  }
  ans = 1000 * N - sum;
  int q = Abs(ans);
  for (i = 1; i <= c; i++) {
    if (q > Abs(ans - i * 1000)) q = Abs(ans - i * 1000);
  }
  printf("%d.%03d\n", q / 1000, q % 1000);
  return 0;
}
