#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
int main() {
  int n, m, k = 0;
  double a[4009], s = 0;
  scanf("%d", &n);
  m = 2 * n;
  for (int i = 1; i <= m; ++i) {
    scanf("%lf", &a[i]);
    s += (a[i] - floor(a[i]));
    if (a[i] - floor(a[i]) < eps) {
      ++k;
    }
  }
  double ans = 99999999;
  for (int i = n; i >= n - k; --i) {
    ans = min(ans, fabs(i - s));
  }
  printf("%.3lf\n", ans);
  return 0;
}
