Jeff got 2n real numbers a1, a2, ..., a2n as a birthday present. The boy hates non-integer numbers, so he decided to slightly "adjust" the numbers he's got. Namely, Jeff consecutively executes n operations, each of them goes as follows:

  * choose indexes i and j (i ≠ j) that haven't been chosen yet; 
  * round element ai to the nearest integer that isn't more than ai (assign to ai: ⌊ ai ⌋); 
  * round element aj to the nearest integer that isn't less than aj (assign to aj: ⌈ aj ⌉). 



Nevertheless, Jeff doesn't want to hurt the feelings of the person who gave him the sequence. That's why the boy wants to perform the operations so as to make the absolute value of the difference between the sum of elements before performing the operations and the sum of elements after performing the operations as small as possible. Help Jeff find the minimum absolute value of the difference.

Input

The first line contains integer n (1 ≤ n ≤ 2000). The next line contains 2n real numbers a1, a2, ..., a2n (0 ≤ ai ≤ 10000), given with exactly three digits after the decimal point. The numbers are separated by spaces.

Output

In a single line print a single real number — the required difference with exactly three digits after the decimal point.

Examples

Input

3
0.000 0.500 0.750 1.000 2.000 3.000


Output

0.250


Input

3
4469.000 6526.000 4864.000 9356.383 7490.000 995.896


Output

0.279

Note

In the first test case you need to perform the operations as follows: (i = 1, j = 4), (i = 2, j = 3), (i = 5, j = 6). In this case, the difference will equal |(0 + 0.5 + 0.75 + 1 + 2 + 3) - (0 + 0 + 1 + 1 + 2 + 3)| = 0.25. 
import java.io.*;
import java.util.StringTokenizer;

public class A {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void solve() throws IOException {
		int n = readInt();
		long[] first = new long[2*n];
		for(int i = 0; i < 2*n; i++) {
			String s = readString();
			first[i] = Integer.parseInt(s.substring(0,s.indexOf('.'))) * 1000L + Integer.parseInt(s.substring(s.indexOf('.')+1));
		}
		long sum = 0;
		long z = 0;
		int count = 0;
		for(int i = 0; i < 2*n; i++) {
			sum += first[i];
			z += (first[i] - (first[i] % 1000));
			count += first[i] % 1000 == 0? 1 : 0;
		}
		int y = 2*n - count;
		if(y > count) {
			z += (n - count)*1000;
			long min = Math.abs(z - sum);
			for(int i = 1; i <= count; i++) {
				min = Math.min(min, Math.abs(sum-(z+1000L*i)));
			}
			String otv = Long.toString(min%1000);
			while (otv.length() < 3) {
				otv = "0" + otv;
			}
			out.println(min / 1000 + "." + otv);
		} else {
			long min = Long.MAX_VALUE/10;
			for(int i = 0; i <= y / 2; i++) {
				long curZ = z + i*1000L;
				for(int j = 0; j <= y-2*i; j++) {
					min = Math.min(min, Math.abs(sum - (curZ + j * 1000L)));
				}
			}
			String otv = Long.toString(min%1000);
			while (otv.length() < 3) {
				otv = "0" + otv;
			}
			out.println(min / 1000 + "." + otv);
		}
    }

    void init() throws FileNotFoundException {
        if (ONLINE_JUDGE) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    int[] readArr(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long[] readArrL(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = readLong();
        }
        return res;
    }

    public static void main(String[] args) {
        new A().run();
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            init();
            solve();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }
}