#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int inf = (int)1e9;
const int MAXN = 70005;
bool cmp(pair<int, int>& a, pair<int, int>& b) { return a.first < b.first; }
int dp[2005][1005];
int main() {
  int n;
  cin >> n;
  dp[0][0] = 0;
  vector<int> a(2 * n);
  vector<int> b(2 * n);
  int x;
  char c;
  int y;
  int coutn = 0;
  for (int i = 0; i < 2 * n; ++i) {
    cin >> x >> c >> y;
    b[i] = x;
    a[i] = y;
    if (a[i] == 0) {
      coutn++;
    }
  }
  long long int total = 0;
  for (int i = 0; i < 2 * n; ++i) {
    total += b[i] * 1000;
    total += a[i];
  }
  long long int total2 = 0;
  for (int i = 0; i < 2 * n; ++i) {
    total2 += b[i] * 1000;
    total2 += 500;
  }
  coutn = min(coutn, n);
  long long int res = abs(total2 - total);
  for (int i = 0; i < coutn; ++i) {
    total2 -= 1000;
    res = min(abs(res), abs(total2 - total));
  }
  int small = res % 1000;
  cout << res / 1000 << ".";
  if (small == 0) {
    cout << "000";
  } else if (small < 10) {
    cout << "00";
    cout << small;
  } else if (small < 100) {
    cout << "0";
    cout << small;
  } else {
    cout << small;
  }
  return 0;
}
