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. 
//package com.a2onlinejudge.ladder.groupcontests.dec28_2016;

import java.io.*;
import java.util.*;

public final class JeffAndRounding
{
	public static void main(String[] args)
	{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		Solver solver = new Solver(in, out);

		try
		{
			solver.solve();
			in.close();
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}

		out.flush();
		out.close();
	}

	static class Solver
	{
		int n;
		int[] arr, cum, suff;
		int[][] dp;
		BufferedReader in;
		PrintWriter out;

		void solve() throws IOException
		{
			n = Integer.parseInt(in.readLine());
			arr = new int[n << 1];
			cum = new int[n << 1];
			suff = new int[n << 1];

			String[] tok = in.readLine().split(" ");

			for (int i = 0; i < n << 1; i++)
			{
				arr[i] = Integer.parseInt(tok[i].substring(tok[i].indexOf('.') + 1, tok[i].length()));
				cum[i] = arr[i];
				suff[i] = (1000 - arr[i]) % 1000;
			}

			for (int i = (n << 1) - 2; i >= 0; i--)
			{
				cum[i] += cum[i + 1];
				suff[i] += suff[i + 1];
			}

//			System.out.println("arr : " + Arrays.toString(arr) + ", cum : " + Arrays.toString(cum) + ", suff : " +
//					Arrays.toString(suff));
			dp = new int[n << 1][n + 1];

			for (int i = 0; i < n << 1; i++)
				Arrays.fill(dp[i], -1);

			double ans = find(0, n);

			out.printf("%.3f", (ans < 0 ? -ans : ans) / 1000);
		}

		int find(int ind, int floorsRemaining)
		{
			if (ind == n << 1)
			{
				if (floorsRemaining > 0)
					return (int) 1e7;

				return 0;
			}

			if (dp[ind][floorsRemaining] != -1)
				return dp[ind][floorsRemaining];

			if (floorsRemaining == 0)
				return dp[ind][floorsRemaining] = -suff[ind];

			// we can round this number to it's floor, or it's ceiling.
//			double roundToFloor = find(ind + 1, floorsRemaining - 1) + Math.floor(arr[ind]) - arr[ind];
//			double roundToCeil = find(ind + 1, floorsRemaining) + Math.ceil(arr[ind]) - arr[ind];
			int roundToFloor = find(ind + 1, floorsRemaining - 1) + arr[ind];
			int roundToCeil = find(ind + 1, floorsRemaining) - (1000 - arr[ind]) % 1000;

//			System.out.println("ind : " + ind + ", fR : " + floorsRemaining + ", rTF : " + roundToFloor + ", rtc : "
//					+ roundToCeil);

			if (Math.abs(roundToFloor) < Math.abs(roundToCeil))
				return dp[ind][floorsRemaining] = roundToFloor;
			else
				return dp[ind][floorsRemaining] = roundToCeil;
		}

		public Solver(BufferedReader in, PrintWriter out)
		{
			this.in = in;
			this.out = out;
		}

	}

}

/*

1
1.250 3.500

3
0.674 0.142 0.000 0.000 0.000 0.000

3
6470.649 8295.000 8486.000 9855.000 223.000 579.549

3
673.674 9263.142 6780.000 9801.000 4640.000 8244.000

3
4469.000 6526.000 4864.000 9356.383 7490.000 995.896

9
5528.000 205.031 5245.169 8832.592 385.656 7126.360 3988.000 9542.000 3044.042 5288.351 9342.000 9979.021 7096.000 5159.200 9400.000 4996.735 1698.000 5403.939

*/
