#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b > a)
    return gcd(b, a);
  else if (b != 0)
    return gcd(b, a % b);
  else
    return a;
}
string to_string(int num) {
  stringstream ss;
  ss << num;
  return ss.str();
}
int dp[4001][2001], a[4001];
int n;
int ans(int i, int rd) {
  if (rd > n) return 2147483647;
  if (i > (n * 2 - 1)) {
    if (rd == n) return 0;
    return 2147483647;
  }
  if (dp[i][rd] != -1) return dp[i][rd];
  int t1 = ans(i + 1, rd + 1) + a[i];
  int t2 = ans(i + 1, rd) - (1000 - a[i]) % 1000;
  if (abs(t1) < abs(t2)) return (dp[i][rd] = t1);
  return (dp[i][rd] = t2);
}
int main() {
  cin.tie(NULL);
  ;
  cout << fixed << setprecision(3);
  double x;
  cin >> n;
  for (int i = 0; i < 2 * n; i++) scanf("%d.%d", &x, &a[i]);
  memset(dp, -1, sizeof(dp[0][0]) * 4001 * 2001);
  cout << ((double)abs(ans(0, 0))) / 1000.0 << endl;
  return 0;
}
