#include <bits/stdc++.h>
using namespace std;
const int Mod = 1e9 + 7;
inline int FIX(int a) { return (a % Mod + Mod) % Mod; }
const int N = 5000 + 5;
int n;
int a[N];
int cal(int x, int y) {
  if (y == 0)
    return x + y;
  else
    return x + y - 1000;
}
int main() {
  scanf("%d", &n);
  n *= 2;
  int cnt = 0, sum = 0;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    int pos = 0;
    for (int p = 0; p < s.length(); p++)
      if (s[p] == '.') {
        pos = p;
        break;
      }
    for (int p = pos + 1; p < s.length(); p++) {
      a[i] = a[i] * 10 + s[p] - '0';
    }
    if (a[i] == 0) cnt++;
    sum += a[i];
  }
  sum -= (n / 2) * 1000;
  int ans = 1e9;
  int cons = min(cnt, n / 2);
  for (int i = 0; i <= cons; i++) {
    ans = min(ans, abs(sum + 1000 * i));
  }
  printf("%.3lf\n", 1.0 * ans / 1000);
  return 0;
}
