#include <bits/stdc++.h>
using namespace std;
const int MAX = 20000 + 10;
int n;
double a[MAX];
int f[MAX], top;
int main() {
  int i;
  scanf("%d", &n);
  int res = 0;
  int ans = 0;
  for ((i) = (1); (i) <= (2 * n); ++(i)) {
    cin >> a[i];
    int b = round(a[i] * 1000);
    b %= 1000;
    if (b == 0) ++res;
    ans -= b;
  }
  int cc = abs(ans + 1000 * n);
  for ((i) = (0); (i) <= (n); ++(i))
    if (i + res >= n) cc = min(cc, abs(ans + i * 1000));
  printf("%.3lf\n", (double)cc / 1000);
  return 0;
}
