#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
string a[4000];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int k = 0;
  int iSum = 0;
  for (int i = 0; i < 2 * n; ++i) {
    cin >> a[i];
    int f = atoi(a[i].substr(a[i].size() - 3).c_str());
    if (f != 0) {
      iSum += 1000 - f;
      ++k;
    }
  }
  int ans = 1e9;
  for (int i = max(0, k - n); i <= min(n, k); ++i) {
    ans = min(ans, abs(iSum - 1000 * i));
  }
  cout << ans / 1000 << '.' << (ans / 100) % 10 << (ans / 10) % 10 << ans % 10
       << endl;
  return 0;
}
