#include <bits/stdc++.h>
using namespace std;
int A[100010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  int wh = 0;
  long long sumi = 0;
  for (int i = 0; i < 2 * n; i++) {
    string s;
    cin >> s;
    A[i] = stoll(s.substr(s.length() - 3, 3));
    if (!A[i]) wh++;
    sumi += A[i];
  }
  long long cur = abs(1000 * n - sumi);
  for (int i = 0; i <= min(wh, n); i++)
    cur = min(cur, abs(n * 1000 - sumi - 1000 * i));
  int x = cur % 1000;
  cout << cur / 1000 << "." << x / 100 << (x % 100) / 10 << (x % 100) % 10
       << '\n';
}
