#include <bits/stdc++.h>
using namespace std;
int a[4444];
int b[4444];
vector<double> l, r, m;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    double x;
    cin >> x;
    int y = (int)(x * 1000 + 0.5);
    a[i] = y % 1000;
  }
  int sum = 0;
  for (int i = 0; i < 2 * n; i++) sum += a[i];
  for (int i = 0; i < 2 * n; i++) b[i] = (a[i] == 0 ? 0 : 1000);
  sort(b, b + 2 * n);
  int low = 0, high = 0;
  for (int i = 0; i < n; i++) low += b[i];
  for (int i = 0; i < n; i++) high += b[n + i];
  int ans = (1 << 30);
  for (int i = low; i <= high; i += 1000) ans = min(ans, abs(i - sum));
  printf("%.3lf", ans / 1000.0);
  return 0;
}
