#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};
double v[2000 * 3];
long long s = 0;
int main() {
  int n;
  cin >> n;
  int c = 0, a = 0, b = 0, d = 0, res = 0, g = 0;
  for (int i = 0; i < 2 * n; i++) {
    cin >> v[i];
    s += (v[i] * 1000.0) + 1e-6;
    long long x = v[i] * 1000.0 + 1e-6;
    res += x / 1000;
    if (x % 1000 != 0) {
      g++;
      int z = x % 1000;
      if (z > 500) {
        a++;
      } else if (z < 500)
        b++;
      else
        d++;
    } else
      c++;
  }
  int zz = s % 1000;
  int sub = abs((s / 1000) - res);
  g = min(g, n);
  int m = min(sub, g);
  sub -= m;
  g -= m;
  if (c >= g && g && zz > 500) {
    zz = 1000 - zz;
    g--;
  }
  g -= min(c, g);
  if (g >= 1) {
    sub += g - 1;
    zz = 1000 - zz;
  }
  double gg = double(sub) + (zz / 1000.0);
  printf("%.3lf\n", gg);
}
