#include <bits/stdc++.h>
using namespace std;
int n;
char c[1000];
long get() {
  int num = strlen(c);
  long ans = 0;
  for (int q = 0; q < num - 4; q++) {
    ans *= 10;
    ans += c[q] - '0';
  }
  for (int q = num - 3; q < num; q++) {
    ans *= 10;
    ans += c[q] - '0';
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  long long z[4005];
  long long sum1 = 0;
  long long sum2 = 0;
  int num = 0;
  long long ans = 100000000000000ll;
  for (int q = 0; q < n * 2; q++) {
    scanf("%s", c);
    z[q] = get();
    if (z[q] % 1000 == 0) num++;
    sum2 += z[q];
    sum1 += (z[q] / 1000) * 1000;
  }
  if (num <= n) {
    sum1 += (n - num) * 1000;
  } else {
    num = n + n - num;
  }
  for (int q = 0; q <= num; q++) {
    ans = min(ans, abs(sum1 - sum2));
    sum1 += 1000;
  }
  cout << ans / 1000 << ".";
  if (ans % 1000 < 1)
    cout << "000" << endl;
  else if (ans % 1000 < 10)
    cout << "00" << ans % 1000 << endl;
  else if (ans % 1000 < 100)
    cout << "0" << ans % 1000 << endl;
  else
    cout << ans % 1000 << endl;
  return 0;
}
