#include <bits/stdc++.h>
using namespace std;
const int N = 4005;
int a[N], n, ans, dp[N][N];
inline int Up(int x) { return (x + 999) / 1000 * 1000; }
inline int Down(int x) { return x / 1000 * 1000; }
int main() {
  scanf("%d", &n);
  int cnt = 0, sum = 0;
  for (int i = 1; i <= n + n; i++) {
    double x;
    scanf("%lf", &x);
    a[i] = (int)(x * 1000 + 0.5);
    if (a[i] % 1000) cnt++;
    sum += Up(a[i]) - a[i];
  }
  ans = N * N;
  for (int i = max(cnt - n, 0); i <= min(cnt, n); i++) {
    ans = min(ans, abs(sum - i * 1000));
  }
  printf("%d.%03d\n", ans / 1000, ans % 1000);
  return 0;
}
