#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
int n, cnt;
double x, s, ans;
int main() {
  cin >> n;
  for (int i = 1; i <= 2 * n; i++) {
    cin >> x;
    s += (x - (int)x);
    if (fabs(x - (int)x) < 1e-8) cnt++;
  }
  s -= n;
  ans = 1e9;
  for (int i = 0; i <= cnt; i++) {
    ans = min(ans, fabs(s + i));
  }
  printf("%.3lf\n", ans);
}
