#include <bits/stdc++.h>
using namespace std;
int n, sum, cnt, up;
double SUM, A[4010];
int main() {
  cin >> up;
  n = 2 * up;
  cnt = sum = SUM = 0.;
  for (int I = 0; I < n; ++I) {
    cin >> A[I];
    SUM += A[I];
    sum += floor(A[I]);
    if (floor(A[I]) == A[I]) cnt++;
  }
  for (int I = 0; I < n; ++I) {
    if (!up) break;
    if (floor(A[I]) == A[I]) continue;
    if (fabs(SUM - sum - 1) > fabs(SUM - sum)) break;
    sum++, up--;
  }
  if (up && cnt < up) sum += up - cnt;
  printf("%.3f\n", fabs(SUM - sum));
  return 0;
}
