#include <bits/stdc++.h>
using namespace std;
inline float minOf(float x, float y) { return (x < y ? x : y); }
inline float maxOf(float x, float y) { return (x > y ? x : y); }
float mabs(float x) {
  if (x < 0.0) return -x;
  return x;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int a[4005];
  string s;
  int pos, cnt = 0;
  int sum = 0;
  for (int i = 1; i <= 2 * n; i++) {
    cin >> s;
    pos = 0;
    while (s[pos] != '.') pos++;
    pos++;
    a[i] = 0;
    for (int j = 0; j < 3; j++) a[i] = a[i] * 10 + s[pos++] - '0';
    if (a[i] == 0) cnt++;
    sum += a[i];
  }
  sum = 1000 * n - sum;
  float mn = mabs(sum);
  for (int i = 1; i <= (int)minOf(cnt, n); i++)
    if (mabs(sum - i * 1000) < mn) mn = mabs(sum - i * 1000);
  float ans = mn;
  ans /= 1000.00;
  cout << fixed;
  cout << setprecision(3) << ans << endl;
  return 0;
}
