#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
const int N = 2005;
const double eps = 1e-9;
int a[2 * N];
int main() {
  int tot = 0;
  int n = 0, s = 0;
  double v = 0.0;
  cin >> n;
  int top = 2 * n;
  for (int i = 0; i < top; ++i) {
    cin >> v;
    a[i] = (int)(v * 1000 + eps);
    if (a[i] % 1000 == 0) ++tot;
    s += a[i] % 1000;
  }
  int ans = INF;
  for (int i = min(tot, n); i >= 0; --i) {
    if (top - tot >= n - i) {
      int sub = abs((n - i) * 1000 - s);
      ans = min(ans, sub);
    }
  }
  printf("%d.%d%d%d\n", ans / 1000, ans % 1000 / 100, ans % 100 / 10, ans % 10);
  return 0;
}
