#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const double eps = 1e-8;
const int maxn = 30000;
int sgn(const double &x) { return (x > eps) - (x < -eps); }
int main() {
  int n;
  scanf("%d", &n);
  int sum = 0;
  int num_0 = 0;
  for (int i = (0); i < (2 * n); ++i) {
    int a, b;
    scanf("%d.%d", &a, &b);
    if (b) {
      sum += b;
    } else
      num_0++;
  }
  int ans = INF;
  for (int i = (0); i <= (n); ++i) {
    if (i + num_0 < n) continue;
    ans = min(ans, abs(i * 1000 - sum));
  }
  printf("%.3lf\n", ans / 1000.0);
  return 0;
}
