#include <bits/stdc++.h>
int abs(int a) {
  if (a < 0)
    return -a;
  else
    return a;
}
int min(int a, int b) {
  if (a > b)
    return b;
  else
    return a;
}
int main() {
  int n, m, i, j, k, x = 0, y = 1000000000, t;
  char s[5];
  scanf("%d", &n);
  j = 2 * n;
  k = 0;
  while (j--) {
    scanf("%d", &m);
    scanf("%s", s);
    m = 0;
    for (i = 1; s[i] != '\0'; i++) m = 10 * m + s[i] - '0';
    for (; i < 4; i++) m *= 10;
    if (m == 0)
      k++;
    else
      x -= m;
  }
  n = 2 * n - k;
  m = k;
  for (k = 0; 2 * k <= n; k++) {
    if (n - 2 * k <= m) {
      t = n - 2 * k;
      for (i = 0; i < t + 1; i++) y = min(y, abs(1000 * (k + i) + x));
    }
  }
  printf("%.3f\n", (double)y / 1000);
  return 0;
}
