#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
int n, i;
int main() {
  scanf("%d", &n);
  int sum = 0;
  int cnt = 0;
  for (i = 0; i < 2 * n; i++) {
    int x, y;
    scanf("%d.%d", &x, &y);
    int val = x * 1000 + y;
    val %= 1000;
    sum -= val;
    if (val == 0) cnt++;
  }
  int ub = min(n, 2 * n - cnt);
  int lb = max(0, n - cnt);
  int ans = INF;
  for (i = lb; i <= ub; i++) ans = min(ans, abs(sum + 1000 * i));
  printf("%.3lf\n", ans * 1.0 / 1000.0);
}
