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. 
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.text.*;

public class cf352c {

    static BufferedReader br;
    static Scanner sc;
    static PrintWriter out;

    public static void initA() {
        try {
            br = new BufferedReader(new InputStreamReader(System.in));
            sc = new Scanner(System.in);
            out = new PrintWriter(System.out);
        } catch (Exception e) {
        }
    }

    public static String getString() {
        try {
            return br.readLine();
        } catch (Exception e) {
        }
        return "";
    }

    public static Integer getInt() {
        try {
            return Integer.parseInt(br.readLine());
        } catch (Exception e) {
        }
        return 0;
    }

    public static Integer[] getIntArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Integer temp2[] = new Integer[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Integer.parseInt(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static Double[] getDoubleArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Double temp2[] = new Double[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Double.parseDouble(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static Long[] getLongArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            Long temp2[] = new Long[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = Long.parseLong(temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static String[] getStringArr() {
        try {
            StringTokenizer temp = new StringTokenizer(br.readLine());
            int n = temp.countTokens();
            String temp2[] = new String[n];
            for (int i = 0; i < n; i++) {
                temp2[i] = (temp.nextToken());
            }
            return temp2;
        } catch (Exception e) {
        }
        return null;
    }

    public static void print(Object a) {
        out.println(a);
    }

    public static void print(String s, Object... a) {
        out.printf(s, a);
    }

    public static int nextInt() {
        return sc.nextInt();
    }

    public static double nextDouble() {
        return sc.nextDouble();
    }

    public static void main(String[] ar) {
        initA();
        if (!tes) {
            solve();
        } else {
            tes();
        }
        out.flush();
    }
    static int op;
    static Double data[];

    public static void solve() {
        op = getInt();
        data = getDoubleArr();

        double ori = 0;
        int h = 0, ct = 0, sama = 0;
        for (double d : data) {

            int turun = (int) d, naik = (int) (d + 0.9999);
            if (turun != naik) {
                ct++;
            } else {
                sama++;
            }
            ori += d;
            h += turun;
        }
        double out = op;
        //print("ORI "+ori+ " "+h);

        for (int i = Math.max(0, op - sama); i <= Math.min(op, 2*op - sama ) ; i++) {
            //  if(i+sama>=op){
            out = Math.min(out, Math.abs(ori - (h + i)));
            //  }
        }

        print("%.3f\n", out);
    }

    private static class data {

        int x, y, val, hash;

        data(int a, int b, int c) {
            x = a;
            y = b;
            val = c;
            hash = (x + " " + y + " " + val).hashCode();
        }

        @Override
        public boolean equals(Object b) {
            data a = (data) b;
            if (a.x == x && a.y == y && a.val == val) {
                return true;
            }
            return false;
        }

        @Override
        public int hashCode() {
            return hash;
        }

        @Override
        public String toString() {
            return x + " " + y + "  =  " + val;
        }
    }
    static boolean tes = false;

    public static void tes() {
        HashSet<data> temp = new HashSet<data>();
        data a = new data(0, 0, 5);
        temp.add(a);

        data b = new data(0, 0, 5);
        if (!temp.contains(b)) {
            temp.add(b);
            print(a.equals(b));
        } else {
            print("SUDAH ADA");
        }
        print(temp);
    }
    
    private static class di implements Comparable<di> {
        int dif, ori;
        di(int a){
           ori = a;
           dif = Math.abs(ori);
        }

        @Override
        public int compareTo(di o) {
            return dif - o.dif;
        }
        @Override
        public String toString(){
            return dif+" "+ori;
        }
        
    }
    static final int inf = 100000000;
    static int dp(int data[], Integer dp[][], int index, int up){
        if(up > op) return inf;
        if(index < 0){
            if(up==op) return 0;
            return inf;
        }
       // System.out.println("MASUK "+index+" "+up);
        if(dp[index][up]!=null) return dp[index][up];
        di re[] = new di[2];
        
        re[0] = new di(dp(data,dp,index-1,up) - data[index]);
        re[1] = new di(dp(data,dp,index-1,up+1) + (1000-data[index])%1000) ;
        
        Arrays.sort(re);
        //print(index+" "+up+ "="+Arrays.asList(re));
        
        return dp[index][up] = re[0].ori;
        
    }

    public static void solve2() {
        op = getInt();
        data = getDoubleArr();

         int dataInt[] = new int[op*2];
         
         for(int i =0 ;i<data.length;i++){
             int a = (int) (data[i]*1000);
             dataInt[i] = a%1000;
         }
         
         Integer dp[][] = new Integer[data.length][2005];
         
         print("%.3f\n",(double)Math.abs(dp(dataInt,dp,data.length-1,0))/1000);
         
         
         

    }
}
