#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum = 0, temp, temp2;
  int zeroes = 0;
  int n, result = 0;
  cin >> n;
  for (int i = 0; i < 2 * n; ++i) {
    scanf("%d.%d", &temp, &temp2);
    sum += temp2;
    if (temp2 == 0) {
      zeroes++;
    }
  }
  int max_sum = n;
  int min_sum = n - zeroes;
  if (sum > max_sum * 1000)
    result = sum - max_sum * 1000;
  else if (sum < min_sum * 1000)
    result = min_sum * 1000 - sum;
  else {
    sum = sum % 1000;
    if (sum <= 500)
      result = sum;
    else
      result = 1000 - sum;
  }
  cout << result / 1000 << '.';
  if (result % 1000 < 10)
    cout << "00";
  else if (result % 1000 < 100)
    cout << "0";
  cout << result % 1000;
}
