#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000 + 10;
const int MAX = 2000 + 10;
int n, cnt = 0;
double input, sum, minimum = INF, s, a;
int main() {
  cin >> n;
  for (int i = 0; i < 2 * n; ++i) {
    cin >> input;
    a = modf(input, &s);
    sum += a;
    if (a == 0) ++cnt;
  }
  for (int i = 0; i <= min(n, cnt); ++i) {
    minimum = min(minimum, abs(n - i - sum));
  }
  cout << fixed << setprecision(3) << minimum;
  return 0;
}
