#include <bits/stdc++.h>
using namespace std;
const int N = 5000;
int a[N];
long long n;
int main() {
  cin >> n;
  n *= 2;
  long long z = 0;
  long long s = 0;
  for (int i = 0; i < n; i++) {
    int h, t;
    scanf("%d.%d", &h, &t);
    a[i] = t;
    z += a[i] == 0;
    s += a[i];
  }
  long long res = n * 500 - s;
  long long ans = abs(res);
  for (int i = 0; i < min(z, n / 2); i++) {
    ans = min(ans, abs(res - (i + 1) * 1000));
  }
  cout << ans / 1000 << "." << setw(3) << setfill('0') << ans % 1000 << endl;
  return 0;
}
