#include <bits/stdc++.h>
using namespace std;
double a[100009];
int main() {
  int n, zero = 0;
  double s = 0;
  scanf("%d", &n);
  for (int i = 1; i <= 2 * n; i++) {
    scanf("%lf", &a[i]);
    a[i] = 1.0 * (a[i] - 1.0 * (int)a[i]);
    if (a[i] - 0 <= 1e-8) zero++;
    s += a[i];
  }
  int u = n - zero < 0 ? 0 : n - zero;
  s -= 1.0 * u;
  if (zero > (int)s && s >= 0) {
    double v = 1.0 * (s - (int)s);
    printf("%.3f\n", min(v, 1 - v));
  } else if (s >= 0) {
    printf("%.3f\n", s - zero);
  } else {
    printf("%.3f\n", abs(s));
  }
  puts("");
  return 0;
}
