#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 5;
const long long MOD = 1000000000 + 7;
const double PI = acos(-1.0);
int main() {
  int x = 0;
  int sum = 0;
  int y = 0;
  int n;
  scanf("%d", &n);
  int mmax = n;
  int mmin = n;
  n = n * 2;
  int p = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d.%d", &x, &y);
    sum += y;
    if (y == 0) {
      mmin--;
    }
  }
  int ans = n * 1000;
  for (int i = mmin; i <= mmax; i++) ans = min(ans, abs(sum - i * 1000));
  cout << ans / 1000 << '.' << ans % 1000 / 100 << ans % 100 / 10 << ans % 10
       << endl;
}
