#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, sum, ans, i, cnt;
  cnt = sum = 0;
  while (scanf("%d", &n) != EOF) {
    ans = 1 << 30;
    for (i = 0; i < 2 * n; i++) {
      scanf("%d.%d", &a, &b);
      sum += b;
      if (b != 0) cnt++;
    }
    int Max = min(cnt, n);
    int Min = max(0, cnt - n);
    for (i = Min; i <= Max; i++) {
      ans = min(ans, abs(sum - i * 1000));
    }
    printf("%d.%03d\n", ans / 1000, ans % 1000);
  }
  return 0;
}
