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