#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  int l, r;
  while (~scanf("%d", &n)) {
    double sum, x;
    for (i = 0, l = 0, r = 0, sum = 0; i < n + n; i++) {
      scanf("%lf", &x);
      int temp = (int)x;
      x = x - (double)temp;
      if (x != 0) {
        sum += x;
        l++;
      } else
        r++;
    }
    int k = (l < n) ? l : n;
    double get = 100000.0;
    for (i = 0; i <= k; i++) {
      if (i + r >= n) {
        get = min(get, fabs(sum - i * 1.0));
      }
    }
    printf("%.3f\n", get);
  }
  return 0;
}
