#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, nz = 0;
  double d[4000], dsum = 0.0, p;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) {
    cin >> p;
    d[i] = p - floor(p);
    dsum += d[i];
    if (p == floor(p)) nz++;
  }
  if (dsum >= n)
    cout << fixed << setprecision(3) << dsum - n << '\n';
  else if ((n - nz) > dsum)
    cout << fixed << setprecision(3) << (n - nz) - dsum << '\n';
  else
    cout << fixed << setprecision(3)
         << min(dsum - floor(dsum), ceil(dsum) - dsum) << '\n';
  return 0;
}
