#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = 10 * x + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int n;
double a[100000 + 5], b[100000 + 5], sum;
inline void print(double ans) { printf("%.3f\n", ans); }
int main() {
  n = read();
  for (int i = 1; i <= (n << 1); i++)
    scanf("%lf", &a[i]), b[i] = a[i] - floor(a[i]), sum += b[i];
  int t1 = 0, t2 = 0;
  for (int i = 1; i <= (n << 1); i++)
    if (b[i] < 1e-10) t2++;
  t1 = 2 * n - t2;
  if (t1 > n) {
    if (sum > n)
      print(sum - n);
    else {
      double t = (double)n - sum;
      if (t2 < t)
        print(t - t2);
      else
        print(min(t - floor(t), (1.0 - t + floor(t))));
    }
  } else {
    if (sum > t1)
      print(sum - t1);
    else {
      double t = t1 - sum;
      print(min(t - floor(t), (1.0 - t + floor(t))));
    }
  }
  return 0;
}
