#include <bits/stdc++.h>
using namespace std;
int a[4010];
int main() {
  int n, tmp, cnt = 0;
  int all = 0;
  scanf("%d", &n);
  for (int i = 0; i < 2 * n; ++i) {
    scanf("%d.%d", &tmp, a + i);
    if (a[i]) ++cnt;
    all += a[i];
  }
  int l = max(0, cnt - n), r = min(cnt, n);
  int ans = 1000000000;
  for (int i = l; i <= r; ++i) {
    ans = min(ans, abs(all - i * 1000));
  }
  printf("%d.%03d\n", ans / 1000, ans % 1000);
}
