#include <bits/stdc++.h>
using namespace std;
int n;
double arr[2008 * 2];
double sum = 0.00;
int tot = 0;
int main() {
  scanf("%d", &n);
  double a;
  int cnt = 0;
  for (int i = 1; i <= 2 * n; i++) {
    cin >> a;
    if (ceil(a) == floor(a)) {
      cnt++;
      continue;
    } else {
      a = fmod(a, 1);
      sum += a;
    }
  }
  if (cnt > n) cnt = n;
  int ans = sum;
  int l = n - cnt;
  int r = n;
  double ANS;
  if (ans <= r && ans >= l) {
    ANS = sum - ans;
    if (ans + 1 <= r) {
      ANS = min(ANS, abs(sum - ans - 1));
    }
  }
  if (ans > r) {
    ANS = sum - r;
  }
  if (ans < l) {
    ANS = abs(sum - l);
  }
  printf("%.3lf", ANS);
  return 0;
}
