#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (b > a) return gcd(b, a);
  return (b == 0) ? a : gcd(b, a % b);
}
int bitcount(int a) { return (a != 0) ? bitcount(a & (a - 1)) + 1 : 0; }
int main() {
  int n, i, j, k, sum = 0, cur, res, cnt = 0, mx, mn;
  double rres, ans;
  string s;
  char c;
  cin >> n;
  mx = n * 1000, mn = 0;
  for (i = 0; i < 2 * n; i++) {
    cin >> s;
    stringstream ss;
    ss << s;
    ss >> k;
    ss >> c;
    ss >> k;
    if (!k)
      cnt++;
    else
      sum += k;
  }
  if (cnt > n)
    mx = (2 * n - cnt) * 1000;
  else
    mn = (n - cnt) * 1000;
  if (sum > mx)
    res = abs(sum - mx);
  else if (sum < mn)
    res = abs(sum - mn);
  else {
    k = sum % 1000;
    res = min(k, 1000 - k);
  }
  rres = res;
  ans = rres / 1000.0;
  printf("%0.3lf\n", ans);
  return 0;
}
