#include <bits/stdc++.h>
using namespace std;
const int maxN = 100 * 1000 + 321;
int a[maxN][2];
int r[maxN];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  double sum = -n;
  n *= 2;
  int count = 0;
  for (int i = 0; i < n; i++) {
    double d;
    cin >> d;
    if (d == int(d)) count++;
    sum += d - int(d);
  }
  double ans = 100000;
  for (int i = 0; i <= count; i++) ans = min(ans, abs(sum + i));
  cout << fixed << setprecision(3) << ans << endl;
  return 0;
}
