#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
const int INF = 0x3F3F3F3F;
const int64_t LINF = 4611686018427387903;
const int MOD = 1e9 + 7;
string out(int a) {
  string res;
  for (int i = 0; i < 3; i++) res.push_back(a % 10 + '0'), a /= 10;
  reverse(res.begin(), res.end());
  return res;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> arr(2 * n);
  int x;
  char w;
  for (int i = 0; i < n * 2; i++) cin >> x >> w >> arr[i];
  int can = 0;
  for (int i = 0; i < 2 * n; i++)
    if (arr[i]) can++;
  int sum = 0;
  for (int i = 0; i < n * 2; i++) sum += arr[i];
  int ans = INF;
  for (int i = max(0, can - n); i <= min(can, n); i++)
    ans = min(ans, abs(sum - i * 1000));
  cout << ans / 1000 << '.' << out(ans % 1000) << '\n';
  return 0;
}
