#include <bits/stdc++.h>
double min(double a, double b) { return a < b ? a : b; }
int main() {
  int n, i;
  scanf("%d", &n);
  int m = 0;
  double s = 0;
  for (i = 0; i < n * 2; i++) {
    double x;
    scanf("%lf", &x);
    double r = x - (int)x;
    if (r > 0) {
      s += r;
      m++;
    }
  }
  int a, b;
  a = (m < n) ? 0 : m - n;
  b = (m < n) ? m : n;
  double r = s - (int)s;
  if (s < a)
    printf("%.3lf\n", a - s);
  else if (s < b)
    printf("%.3lf\n", min(r, 1 - r));
  else
    printf("%.3lf\n", s - b);
  return 0;
}
