#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b;
  scanf("%d", &n);
  int sum = 0, tmp1 = 0, tmp2 = 0;
  for (int i = 0; i < 2 * n; i++) {
    scanf("%d.%d", &a, &b);
    if (!b)
      tmp1++;
    else
      sum += b, tmp2++;
  }
  int ans = 11111111;
  for (int i = max(0, n - tmp1); i <= min(n, tmp2); i++)
    ans = min(ans, abs(i * 1000 - sum));
  printf("%d.%03d\n", ans / 1000, ans % 1000);
  return 0;
}
