#include <bits/stdc++.h>
using namespace std;
ifstream fin("AAtest.in.txt");
const int N = 4e3 + 9;
int n, c, cu, ma, mi;
double d, su, vas;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cerr.tie(0);
  cin >> n;
  int m = 0;
  for (int(i) = (0); ((i)) < ((2 * n)); ((i))++) {
    cin >> d;
    su += d;
    c = (int)d;
    cu += c;
    if ((double)(d - c) > 0) m++;
  }
  ma = cu + min(m, n);
  mi = cu + max(0, m - n);
  if (su > ma)
    vas = su - ma;
  else if (su < mi)
    vas = mi - su;
  else {
    int c = (int)su;
    su -= c;
    if ((double)1 - su < su)
      vas = (double)1 - su;
    else
      vas = su;
  }
  cout << setprecision(3) << fixed << vas;
}
