#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int initSum = 0, noFrac = 0, fullSum = 0, fractSum = 0;
  for (int i = 0; i < 2 * n; i++) {
    int a, b;
    if (b == 0) noFrac++;
    scanf("%d.%d", &a, &b);
    fullSum += a, fractSum += b;
  }
  initSum = 1000 * fullSum + fractSum;
  long long int gmin = 1 << 30;
  for (int i = max(n - noFrac, 0); i <= min(n, 2 * n - noFrac); i++) {
    long long int diff = abs(1000 * fullSum + 1000 * i - initSum);
    gmin = min(gmin, diff);
  }
  printf("%.3f", gmin / 1000.0f);
  return 0;
}
