#include <bits/stdc++.h>
int abs(int a) {
  if (a < 0)
    return -a;
  else
    return a;
}
int Min(int a, int b) {
  if (a < b)
    return a;
  else
    return b;
}
int main() {
  int n, i;
  while (scanf("%d", &n) != EOF) {
    int n2 = n * 2;
    int ret = 9999999, temp, all = 0, k = 0;
    for (i = 1; i <= n2; i++) {
      scanf("%*d.%d", &temp);
      all += temp;
      if (temp == 0) k++;
    }
    for (i = 0; i <= k; i++) {
      ret = Min(ret, abs(all - (1000 * n - 1000 * i)));
    }
    printf("%d.%03d\n", ret / 1000, ret % 1000);
  }
  return 0;
}
