#include <bits/stdc++.h>
using namespace std;
int n, Z;
int MX, MN;
int main() {
  int s = 0;
  scanf("%d", &n);
  for (int i = 1; i <= 2 * n; ++i) {
    int x, y;
    char a, b, c;
    scanf("%d.%c%c%c", &x, &a, &b, &c);
    y = (a - '0') * 100 + (b - '0') * 10 + c - '0';
    if (y == 0)
      Z++;
    else
      s += 1000 - y;
  }
  MX = min(2 * n - Z, n);
  MN = max(0, n - Z);
  int ans = 999999999;
  for (int i = MN; i <= MX; ++i) ans = min(ans, abs(s - 1000 * i));
  printf("%.3lf\n", ans * 1.0 / 1000.0);
}
