#include <bits/stdc++.h>
using namespace std;
const int N = 4010;
char s[1000];
int a[N];
int main() {
  int n;
  scanf("%d", &n);
  n <<= 1;
  for (int i = 1; i <= n; i++) {
    scanf("%s", s);
    int len = strlen(s);
    a[i] =
        (s[len - 3] - '0') * 100 + (s[len - 2] - '0') * 10 + s[len - 1] - '0';
  }
  int ans = 0, sum = 0;
  for (int i = 1; i <= n; i++) {
    ans += a[i];
    if (a[i] == 0) sum++;
  }
  n >>= 1;
  int l = ans - n * 1000, r = ans - max(0, n - sum) * 1000;
  if (l >= 0) {
    printf("%.3f\n", l / 1000.0);
  } else if (r <= 0) {
    printf("%.3f\n", abs(r) / 1000.0);
  } else {
    ans %= 1000;
    printf("%.3f\n", min(ans, 1000 - ans) / 1000.0);
  }
  return 0;
}
