#include <bits/stdc++.h>
using namespace std;
int x, n, i, s1, s2;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= 2 * n; i++) {
    scanf("%d.%d", &x, &x);
    if (x) s1 += x, s2++;
  }
  int t = 999999999;
  for (i = max(s2 - n, 0); i <= min(s2, n); i++) t = min(t, abs(s1 - 1000 * i));
  printf("%d.%03d", t / 1000, t % 1000);
  return 0;
}
