#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 2000;
int n;
int x[2 * N_MAX];
int y[2 * N_MAX];
void solve() {
  int d = 0;
  int z = 0;
  for (int i = 0; i < (2 * n); ++i) {
    d += y[i];
    if (y[i] == 0) ++z;
  }
  int ans = abs(d - max(n - z, min(n, (d + 500) / 1000)) * 1000);
  int ans0 = ans / 1000;
  int ans1 = ans % 1000;
  printf("%d.%03d\n", ans0, ans1);
}
int main() {
  cin >> n;
  for (int i = 0; i < (2 * n); ++i) scanf("%d.%d", &x[i], &y[i]);
  solve();
  return 0;
}
