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