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