#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list;
bool cmp (double a, double b){
    return a -(int) a < b- (int) b;
}

int main() {
    int n, zero_cnt = 0;
    cin >> n;
    double t, res, ans = 10000000;

    for (int i = 0; i < 2 * n; ++i) {
        cin >> t;
        if (t - (int) t < 1e-5)
            ++zero_cnt;
        else
            list.push_back(t);
    }

    sort(list.begin(),list.end(),cmp);

    if (zero_cnt == 0) {
        res =0;
        for (int i = 0; i < n; ++i)
            res -= (list[i] - (int) list[i]);
        for (int i = n; i < 2 * n; ++i)
            res += (ceil(list[i]) - list[i]);

        printf("%.3f",abs(res));
        return 0;
    }

    for (int k = 0; k <= n; ++k) {
        int cnt_l;
        res = 0;

        if (k >= n) {

            for (int i = 0; i < (int) list.size(); ++i) {
                if (i < n)
                    res -= (list[i] - (int) list[i]);
                else
                    res += (ceil(list[i]) - list[i]);
            }

        } else {
            int tmp = k+zero_cnt-1;
            cnt_l = k + ((n-1-tmp) <0 ? 0 : n-1-tmp ) ;

            for (int i = 0; i < cnt_l && i < (int) list.size(); ++i) {
                res -= (list[i] - (int) list[i]);
            }

            for (int i = cnt_l; i < (int) list.size(); ++i) {
                res += (ceil(list[i]) - list[i]);
            }
        }

        ans = min(ans, abs(res));
    }

    printf("%.3f", ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list;
bool cmp (double a, double b){
    return a -(int) a < b- (int) b;
}

int main() {
    int n, zero_cnt = 0;
    cin >> n;
    double t, res, ans = 10000000;

    for (int i = 0; i < 2 * n; ++i) {
        cin >> t;
        if (t - (int) t < 1e-5)
            ++zero_cnt;
        else
            list.push_back(t);
    }

    sort(list.begin(),list.end(),cmp);

    if (zero_cnt == 0) {
        res =0;
        for (int i = 0; i < n; ++i)
            res -= (list[i] - (int) list[i]);
        for (int i = n; i < 2 * n; ++i)
            res += (ceil(list[i]) - list[i]);

        cout << abs(res);
        return 0;
    }

    for (int k = 0; k < 2 * n; ++k) {
        int cnt_l;
        res = 0;

        if (k >= n) {

            for (int i = 0; i < (int) list.size(); ++i) {
                if (i < n)
                    res -= (list[i] - (int) list[i]);
                else
                    res += (ceil(list[i]) - list[i]);
            }

        } else {
            int tmp = k+zero_cnt-1;
            cnt_l = k + ((n-1-tmp) <0 ? 0 : n-1-tmp ) ;

            for (int i = 0; i < cnt_l && i < (int) list.size(); ++i) {
                res -= (list[i] - (int) list[i]);
            }

            for (int i = cnt_l; i < (int) list.size(); ++i) {
                res += (ceil(list[i]) - list[i]);
            }
        }

        ans = min(ans, abs(res));
    }

    printf("%.3f", ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list ;

int main (){
    int n,zero_cnt=0;
    cin>>n;
    double tmp,res, ans =10000000;

    for(int i=0;i<2*n;++i){
        cin>>tmp;
        if(tmp -(int) tmp < 1e-5)
            ++ zero_cnt ;
        else
            list.push_back(tmp);
    }

    if(zero_cnt ==0){

        for(int i=0;i<n;++i)
            res -= (list[i] - (int) list[i]);
        for(int i=n;i<2*n;++i)
            res += (ceil(list[i])- list[i]);

        cout<<abs(res);
        return 0;
    }

    for(int k=0;k<2*n;++k){
        int cnt_l ;
        if(cnt_l >n)
            cnt_l = n;
        else{
            cnt_l = (k-0)+( (n-1-(k+zero_cnt))< 0 ? 0 : n-(k+zero_cnt));
        }
        res = 0;

        //cout<<cnt_l<<endl;
        //cnt_l = min (cnt_l,n);

        for(int i=0;i<cnt_l && i<(int)list.size();++i){
            res -= (list[i] - (int) list[i]);
            //cout<<list[i]<<" ";
        }
        //cout<<"- ";
        for(int i=cnt_l;i<(int)list.size();++i){
            res += (ceil(list[i])- list[i]);
            //cout<<list[i]<<" ";
        }
        //cout<<endl<<res<<endl;
        ans = min (ans,abs(res));
    }

    //cout<<ans-(1e-3);
    printf("%.3f",ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

double arr [4004];

bool comp (double a, double b){
    if(abs(a - (int) a) < (1e-9) && b-(int) b <0.5)
        return false ;

    if(abs(b - (int) b) < (1e-9) && a-(int) a <0.5)
            return true ;

    return (a-(int)a < b-(int)b);
}

int main (){
    int n;
    double sum =0,res=0;
    cin>>n;
    n*=2;

    for(int i=0;i<n;++i){
        cin>>arr[i];
        sum += arr[i];
    }

    //cout<<sum<<endl;

    sort(arr,arr+n,comp);
    n/=2;

    for(int i=0;i<n;++i){
        res += (int)arr[i];
        //cout<<(int) arr[i]<<" ";
    }

    //cout<<endl;
    for(int i=n;i<2*n;++i){
        res +=ceil(arr[i]);
        //cout<<ceil(arr[i])<<" ";
    }

    //cout<<res<<endl<<abs(res-sum)<<endl;
    printf("%.3f",abs(res-sum));

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list;

int main() {
    int n, zero_cnt = 0;
    cin >> n;
    double tmp, res, ans = 10000000;

    for (int i = 0; i < 2 * n; ++i) {
        cin >> tmp;
        if (tmp - (int) tmp < 1e-5)
            ++zero_cnt;
        else
            list.push_back(tmp);
    }

    if (zero_cnt == 0) {

        for (int i = 0; i < n; ++i)
            res -= (list[i] - (int) list[i]);
        for (int i = n; i < 2 * n; ++i)
            res += (ceil(list[i]) - list[i]);

        cout << abs(res);
        return 0;
    }

    for (int k = 0; k < 2 * n; ++k) {
        int cnt_l;
        res = 0;
        if (k >= n) {

            for (int i = 0; i < (int) list.size(); ++i) {
                if (i < n)
                    res -= (list[i] - (int) list[i]);
                else
                    res += (ceil(list[i]) - list[i]);
            }

        } else {
            int tmp = (k>0)? k+zero_cnt : k+zero_cnt-1;
            cnt_l = k + ((n-1-tmp) <0 ?0:n-1-tmp) ;

            //cout<<cnt_l<<endl;

            for (int i = 0; i < cnt_l && i < (int) list.size(); ++i) {
                res -= (list[i] - (int) list[i]);
            }

            for (int i = cnt_l; i < (int) list.size(); ++i) {
                res += (ceil(list[i]) - list[i]);
            }
        }

        ans = min(ans, abs(res));
    }

    printf("%.3f", ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list;

bool cmp (double a, double b){
    return a -(int) a < b- (int) b;
}

int main() {
    int n, zero_cnt = 0;
    cin >> n;
    double tmp, res, ans = 10000000;

    for (int i = 0; i < 2 * n; ++i) {
        cin >> tmp;
        if (tmp - (int) tmp < 1e-5)
            ++zero_cnt;
        else
            list.push_back(tmp);
    }

    sort(list.begin(),list.end(),cmp);

    if (zero_cnt == 0) {
        res =0;
        for (int i = 0; i < n; ++i)
            res -= (list[i] - (int) list[i]);
        for (int i = n; i < 2 * n; ++i)
            res += (ceil(list[i]) - list[i]);

        cout << abs(res);
        return 0;
    }

    for (int k = 0; k < 2 * n; ++k) {
        int cnt_l;
        res = 0;

        if (k >= n) {

            for (int i = 0; i < (int) list.size(); ++i) {
                if (i < n)
                    res -= (list[i] - (int) list[i]);
                else
                    res += (ceil(list[i]) - list[i]);
            }

        } else {
            int t = k+zero_cnt-1;
            cnt_l = k + ((n-1-t) <0 ? 0 : n-1-t ) ;

            for (int i = 0; i < cnt_l; ++i) {
                res -= (list[i] - (int) list[i]);
            }

            for (int i = cnt_l; i < (int) list.size(); ++i) {
                res += (ceil(list[i]) - list[i]);
            }
        }

        ans = min(ans, abs(res));
    }

    printf("%.3f", ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list;

int main() {
    int n, zero_cnt = 0;
    cin >> n;
    double tmp, res, ans = 10000000;

    for (int i = 0; i < 2 * n; ++i) {
        cin >> tmp;
        if (tmp - (int) tmp < 1e-5)
            ++zero_cnt;
        else
            list.push_back(tmp);
    }

    if (zero_cnt == 0) {
        res =0;
        for (int i = 0; i < n; ++i)
            res -= (list[i] - (int) list[i]);
        for (int i = n; i < 2 * n; ++i)
            res += (ceil(list[i]) - list[i]);

        cout << abs(res);
        return 0;
    }

    for (int k = 0; k < 2 * n; ++k) {
        int cnt_l;
        res = 0;
        if (k >= n) {

            for (int i = 0; i < (int) list.size(); ++i) {
                if (i < n)
                    res -= (list[i] - (int) list[i]);
                else
                    res += (ceil(list[i]) - list[i]);
            }

        } else {
            int tmp = (k>0)? k+zero_cnt : k+zero_cnt-1;
            cnt_l = k + ((n-1-tmp) <0 ?0:n-1-tmp) ;

            for (int i = 0; i < cnt_l && i < (int) list.size(); ++i) {
                res -= (list[i] - (int) list[i]);
            }

            for (int i = cnt_l; i < (int) list.size(); ++i) {
                res += (ceil(list[i]) - list[i]);
            }
        }

        ans = min(ans, abs(res));
    }

    printf("%.3f", ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list ;

int main (){
    int n,zero_cnt=0;
    cin>>n;
    double tmp,res, ans =10000000;

    for(int i=0;i<2*n;++i){
        cin>>tmp;
        if(tmp -(int) tmp < 1e-5)
            ++ zero_cnt ;
        else
            list.push_back(tmp);
    }

    for(int k=0;k<2*n;++k){
        int cnt_l = min(n,(k-0)+ max(0,n-1-(k+zero_cnt)));
        res = 0;
        //cout<<cnt_l<<endl;
        for(int i=0;i<cnt_l;++i){
            res -= (list[i] - (int) list[i]);
            //cout<<list[i]<<" ";
        }
    //  cout<<"- ";
        for(int i=cnt_l;i<(int)list.size();++i){
            res += (ceil(list[i])- list[i]);
            //cout<<list[i]<<" ";
        }
        //cout<<endl<<res<<endl;
        ans = min (ans,abs(res));
    }

    //cout<<endl;
    printf("%.3f",ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list;

int main() {
    int n, zero_cnt = 0;
    cin >> n;
    double tmp, res, ans = 10000000;

    for (int i = 0; i < 2 * n; ++i) {
        cin >> tmp;
        if (tmp - (int) tmp < 1e-5)
            ++zero_cnt;
        else
            list.push_back(tmp);
    }

    if (zero_cnt == 0) {
        res =0;
        for (int i = 0; i < n; ++i)
            res -= (list[i] - (int) list[i]);
        for (int i = n; i < 2 * n; ++i)
            res += (ceil(list[i]) - list[i]);

        cout << abs(res);
        return 0;
    }

    for (int k = 0; k < 2 * n; ++k) {
        int cnt_l;
        res = 0;
        if (k >= n) {

            for (int i = 0; i < (int) list.size(); ++i) {
                if (i < n)
                    res -= (list[i] - (int) list[i]);
                else
                    res += (ceil(list[i]) - list[i]);
            }

        } else {
            int tmp = k+zero_cnt-1;
            cnt_l = k + ((n-1-tmp) <0 ? 0 : n-1-tmp ) ;

            for (int i = 0; i < cnt_l && i < (int) list.size(); ++i) {
                res -= (list[i] - (int) list[i]);
            }

            for (int i = cnt_l; i < (int) list.size(); ++i) {
                res += (ceil(list[i]) - list[i]);
            }
        }

        ans = min(ans, abs(res));
    }

    printf("%.3f", ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list ;

int main (){
    int n,zero_cnt=0;
    cin>>n;
    double tmp,res, ans =10000000;

    for(int i=0;i<2*n;++i){
        cin>>tmp;
        if(tmp -(int) tmp < 1e-5)
            ++ zero_cnt ;
        else
            list.push_back(tmp);
    }

    for(int k=0;k<=n;++k){
        int cnt_l = (k-0)+ max(0,n-1-(k+zero_cnt));
        res = 0;

        //cnt_l = min (cnt_l,n);

        for(int i=0;i<cnt_l && i<(int)list.size();++i){
            res -= (list[i] - (int) list[i]);
            //cout<<list[i]<<" ";
        }
        //cout<<"- ";
        for(int i=cnt_l;i<(int)list.size();++i){
            res += (ceil(list[i])- list[i]);
            //cout<<list[i]<<" ";
        }
        //cout<<endl<<res<<endl;
        ans = min (ans,abs(res));
    }

    printf("%.3f",ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list;
bool cmp (double a, double b){
    return a -(int) a < b- (int) b;
}

int main() {
    int n, zero_cnt = 0;
    cin >> n;
    double tmp, res, ans = 10000000;

    for (int i = 0; i < 2 * n; ++i) {
        cin >> tmp;
        if (tmp - (int) tmp < 1e-5)
            ++zero_cnt;
        else
            list.push_back(tmp);
    }

    sort(list.begin(),list.end(),cmp);

    if (zero_cnt == 0) {
        res =0;
        for (int i = 0; i < n; ++i)
            res -= (list[i] - (int) list[i]);
        for (int i = n; i < 2 * n; ++i)
            res += (ceil(list[i]) - list[i]);

        cout << abs(res);
        return 0;
    }

    for (int k = 0; k < 2 * n; ++k) {
        int cnt_l;
        res = 0;

        if (k >= n) {

            for (int i = 0; i < (int) list.size(); ++i) {
                if (i < n)
                    res -= (list[i] - (int) list[i]);
                else
                    res += (ceil(list[i]) - list[i]);
            }

        } else {
            int tmp = k+zero_cnt-1;
            cnt_l = k + ((n-1-tmp) <0 ? 0 : n-1-tmp ) ;

            for (int i = 0; i < cnt_l && i < (int) list.size(); ++i) {
                res -= (list[i] - (int) list[i]);
            }

            for (int i = cnt_l; i < (int) list.size(); ++i) {
                res += (ceil(list[i]) - list[i]);
            }
        }

        ans = min(ans, abs(res));
    }

    printf("%.3f", ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list ;

int main (){
    int n,zero_cnt=0;
    cin>>n;
    double tmp,res, ans =10000000;

    for(int i=0;i<2*n;++i){
        cin>>tmp;
        if(tmp -(int) tmp < 1e-5)
            ++ zero_cnt ;
        else
            list.push_back(tmp);
    }

    for(int k=0;k<2*n;++k){
        int cnt_l = (k-0)+ max(0,n-1-(k+zero_cnt));
        res = 0;
        //cout<<cnt_l<<endl;
        for(int i=0;i<cnt_l;++i){
            res -= (list[i] - (int) list[i]);
            //cout<<list[i]<<" ";
        }
        for(int i=cnt_l;i<(int)list.size();++i){
            res += (ceil(list[i])- list[i]);
            //cout<<list[i]<<" ";
        }
        //cout<<endl<<res<<endl;
        ans = min (ans,abs(res));
    }

    //cout<<endl;
    printf("%.3f",ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list ;

int main (){
    int n,zero_cnt=0;
    cin>>n;
    double tmp,res, ans =10000000;

    for(int i=0;i<2*n;++i){
        cin>>tmp;
        if(tmp -(int) tmp < 1e-5)
            ++ zero_cnt ;
        else
            list.push_back(tmp);
    }

    for(int k=0;k<2*n;++k){
        int cnt_l = (k-0)+ max(0,n-1-(k+zero_cnt));
        res = 0;

        cnt_l = min (cnt_l,n);

        for(int i=0;i<cnt_l && i<(int)list.size();++i){
            res -= (list[i] - (int) list[i]);
            //cout<<list[i]<<" ";
        }
        //cout<<"- ";
        for(int i=cnt_l;i<(int)list.size();++i){
            res += (ceil(list[i])- list[i]);
            //cout<<list[i]<<" ";
        }
        //cout<<endl<<res<<endl;
        ans = min (ans,abs(res));
    }

    printf("%.3f",ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

double arr [4004];

bool comp (double a, double b){
    if(abs(a - (int) a) < (1e-9) && b-(int) b <=0.5 )
        return false ;

    if(abs(b - (int) b) < (1e-9) && a-(int) a <=0.5 )
            return true ;

    return (a-(int)a < b-(int)b);
}

int main (){
    int n;
    double sum =0,res=0;
    cin>>n;
    n*=2;

    for(int i=0;i<n;++i){
        cin>>arr[i];
        sum += arr[i];
    }

    //cout<<sum<<endl;

    sort(arr,arr+n,comp);
    n/=2;

    for(int i=0;i<n;++i){
        res += (int)arr[i];
        //cout<<arr[i]<<" ";
    }

    //cout<<endl;
    for(int i=n;i<2*n;++i){
        res +=ceil(arr[i]);
        //cout<<arr[i]<<" ";
    }
    //cout<<endl;
    //cout<<res<<endl<<abs(res-sum)<<endl;
    printf("%.3f",abs(res-sum));

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list ;

int main (){
    int n,zero_cnt=0;
    cin>>n;
    double tmp,res, ans =10000000;

    for(int i=0;i<2*n;++i){
        cin>>tmp;
        if(tmp -(int) tmp < 1e-5)
            ++ zero_cnt ;
        else
            list.push_back(tmp);
    }

    for(int k=0;k<n;++k){
        int cnt_l = (k-0)+ max(0,n-1-(k+zero_cnt));
        res = 0;

        //cnt_l = min (cnt_l,n);

        for(int i=0;i<cnt_l && i<(int)list.size();++i){
            res -= (list[i] - (int) list[i]);
            //cout<<list[i]<<" ";
        }
        //cout<<"- ";
        for(int i=cnt_l;i<(int)list.size();++i){
            res += (ceil(list[i])- list[i]);
            //cout<<list[i]<<" ";
        }
        //cout<<endl<<res<<endl;
        ans = min (ans,abs(res));
    }

    printf("%.3f",ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list;

bool cmp (double a, double b){
    return a -(int) a < b- (int) b;
}

int main() {
    int n, zero_cnt = 0;
    cin >> n;
    double tmp, res, ans = 10000000;

    for (int i = 0; i < 2 * n; ++i) {
        cin >> tmp;
        if (tmp - (int) tmp < 1e-5)
            ++zero_cnt;
        else
            list.push_back(tmp);
    }

    sort(list.begin(),list.end(),cmp);

    if (zero_cnt == 0) {
        res =0;
        for (int i = 0; i < n; ++i)
            res -= (list[i] - (int) list[i]);
        for (int i = n; i < 2 * n; ++i)
            res += (ceil(list[i]) - list[i]);

        cout << abs(res);
        return 0;
    }

    for (int k = 0; k <=n; ++k) {
        int cnt_l;
        res = 0;

        if (k == n) {

            for (int i = 0; i < (int) list.size(); ++i) {
                if (i < n)
                    res -= (list[i] - (int) list[i]);
                else
                    res += (ceil(list[i]) - list[i]);
            }

        } else {
            int t = k+zero_cnt-1;
            cnt_l = k + ((n-1-t) <0 ? 0 : n-1-t ) ;

            for (int i = 0; i < cnt_l; ++i) {
                res -= (list[i] - (int) list[i]);
            }

            for (int i = cnt_l; i < (int) list.size(); ++i) {
                res += (ceil(list[i]) - list[i]);
            }
        }

        ans = min(ans, abs(res));
    }

    printf("%.3f", ans);

    return 0;
}


#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <queue>

using namespace std;

vector<double> list ;

int main (){
	int n,zero_cnt=0;
	cin>>n;
	double tmp,res, ans =10000000;

	for(int i=0;i<2*n;++i){
		cin>>tmp;
		if(tmp -(int) tmp < 1e-5)
			++ zero_cnt ;
		else
			list.push_back(tmp);
	}

	for(int k=0;k<=n;++k){
		int cnt_l = (k-0)+( (n-1-(k+zero_cnt))< 0 ? 0 : n-1-(k+zero_cnt));
		res = 0;

		//cout<<cnt_l<<endl;
		//cnt_l = min (cnt_l,n);

		for(int i=0;i<cnt_l && i<(int)list.size();++i){
			res -= (list[i] - (int) list[i]);
		//	cout<<list[i]<<" ";
		}
		//cout<<"- ";
		for(int i=cnt_l;i<(int)list.size();++i){
			res += (ceil(list[i])- list[i]);
			//cout<<list[i]<<" ";
		}
		//cout<<endl<<res<<endl;
		ans = min (ans,abs(res));
	}

	printf("%.3f",ans);

	return 0;
}


#include <cstdio>
#include <algorithm>
using namespace std;

const int INF = 1000000007;

int main(){
    int n,x,cnt=0,sum=0,ans=INF;
    scanf("%d",&n);
    for(int i=0;i<n+n;i++){
        scanf("%*d.%d",&x);
        cnt+=x==0;
        sum+=x;
    }
    for(int i=max(n-cnt,0);i<=min(n+n-cnt,n);i++)
        ans=min(ans,abs(sum-1000*i));
    printf("%d.%03d\n",ans/1000,ans%1000);
}


#include <stdio.h>
#include <iostream>
#include <math.h>
#include <string.h>
using namespace std;
int main ()
{
    int n,s1,s2,i;
    while(scanf("%d",&n)!=EOF)
	{
        double sum,x;
        for(i=0,s1=0,s2=0,sum=0;i<n+n;i++)
		{
            scanf("%lf",&x);
            int temp=(int)x;
            x=x-(double)temp;
            if(x!=0)
            sum+=x,s1++;
            else s2++;
        }
        int k=min(s1,n);
        double ans=100000000.0;
        for(i=0;i<=k;i++)
		{
            if(i+s2>=n)
            	ans=min(ans,fabs(sum-i*1.0));
        }
        printf("%.3f\n",ans);
    }
    return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>

using namespace std;

double up[4010],down[4010];
double num[4010];
double mi=0,ans;

int main()
{
	int n;
//	freopen("data.txt","r",stdin);
	scanf("%d",&n);
	for(int i=0;i<2*n;i++)
	{
		scanf("%lf",&num[i]);
		down[i]=(int)num[i]-num[i];
		up[i]=down[i]+1;
	}
	for(int i=0;i<2*n;i++)
	{
		if(fabs(mi+up[i])>fabs(mi+down[i]))
			mi+=down[i];
		else
			mi+=up[i];
	}
	printf("%.3lf\n",fabs(mi));
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define debug(args...) fprintf(stderr,args)

typedef long long lint;
typedef pair<int,int> pii;
typedef pair<lint,lint> pll;

const int INF = 0x3f3f3f3f;
const lint LINF = 0x3f3f3f3f3f3f3f3fll;
const double EPS = 1e-6;

bool equals(double a,double b) { return fabs(a-b) < EPS; }

int main() {
    int n;
    scanf("%d",&n);
    int ans = 0;
    int qntd = 0, free = 0;
    for(int a=0;a<2*n;++a) {
        int q;
        scanf("%*d.%d",&q);
        if(!q) ++free;
        else {
            ans += q;
            ++qntd;
        }
    }
    int able = min(qntd,n), needs = max(0,able-free);
    able -= needs;
    ans -= 1000*needs;
    if(ans >= 1000*able) ans -= 1000*able;
    else {
        able -= ans/1000;
        ans %= 1000;
        if(able && ans > 1000-ans) ans = 1000-ans;
    }
    ans = abs(ans);
    printf("%d.%03d\n",ans/1000,ans%1000);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define debug(args...) fprintf(stderr,args)

typedef long long lint;
typedef pair<int,int> pii;
typedef pair<lint,lint> pll;

const int INF = 0x3f3f3f3f;
const lint LINF = 0x3f3f3f3f3f3f3f3fll;
const double EPS = 1e-6;

bool equals(double a,double b) { return fabs(a-b) < EPS; }

int main() {
    int n;
    scanf("%d",&n);
    int ans = 0;
    int qntd = 0;
    for(int a=0;a<2*n;++a) {
        int q;
        scanf("%*d.%d",&q);
        if(!q) continue;
        ans += q;
        ++qntd;
    }
    qntd = min(qntd,n);
    if(ans > 1000*qntd) ans -= 1000*qntd;
    else ans = min(ans%1000, (1000 - ans%1000));
    printf("%d.%3d\n",ans/1000,ans%1000);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define debug(args...) fprintf(stderr,args)

typedef long long lint;
typedef pair<int,int> pii;
typedef pair<lint,lint> pll;

const int INF = 0x3f3f3f3f;
const lint LINF = 0x3f3f3f3f3f3f3f3fll;

int main() {
    int n;
    scanf("%d",&n);
    int ans = 0;
    int qntd = 0, free = 0;
    for(int a=0;a<2*n;++a) {
        int q;
        scanf("%*d.%d",&q);
        if(!q) ++free;
        else {
            ans += q;
            ++qntd;
        }
    }
    int able = min(qntd,n), needs = max(0,able-free);
    able -= needs;
    ans -= 1000*needs;
    if(ans < 0) ans = abs(ans);
    else if(ans >= 1000*able) ans -= 1000*able;
    else {
        able -= ans/1000;
        ans %= 1000;
        if(able && ans > 1000-ans) ans = 1000-ans;
    }
    printf("%d.%03d\n",ans/1000,ans%1000);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define debug(args...) fprintf(stderr,args)

typedef long long lint;
typedef pair<int,int> pii;
typedef pair<lint,lint> pll;

const int INF = 0x3f3f3f3f;
const lint LINF = 0x3f3f3f3f3f3f3f3fll;
const double EPS = 1e-6;

bool equals(double a,double b) { return fabs(a-b) < EPS; }

int main() {
    int n;
    scanf("%d",&n);
    int ans = 0;
    int qntd = 0;
    for(int a=0;a<2*n;++a) {
        int q;
        scanf("%*d.%d",&q);
        if(!q) continue;
        ans += q;
        ++qntd;
    }
    if(ans > 1000*qntd) ans -= 1000*qntd;
    else ans = min(ans%1000, (1000 - ans%1000));
    printf("%d.%3d\n",ans/1000,ans%1000);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define debug(args...) fprintf(stderr,args)

typedef long long lint;
typedef pair<int,int> pii;
typedef pair<lint,lint> pll;

const int INF = 0x3f3f3f3f;
const lint LINF = 0x3f3f3f3f3f3f3f3fll;
const double EPS = 1e-6;

bool equals(double a,double b) { return fabs(a-b) < EPS; }

int main() {
    int n;
    scanf("%d",&n);
    int ans = 0;
    int qntd = 0, free = 0;
    for(int a=0;a<2*n;++a) {
        int q;
        scanf("%*d.%d",&q);
        if(!q) ++free;
        else {
            ans += q;
            ++qntd;
        }
    }
    int able = min(qntd,n), needs = max(0,n-free);
    able -= needs;
    ans -= 1000*needs;
    if(ans >= 1000*able) ans -= 1000*able;
    else {
        able -= ans/1000;
        ans %= 1000;
        if(able && ans > 1000-ans) ans = 1000-ans;
    }
    printf("%d.%3d\n",ans/1000,ans%1000);
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

#define debug(args...) fprintf(stderr,args)

typedef long long lint;
typedef pair<int,int> pii;
typedef pair<lint,lint> pll;

const int INF = 0x3f3f3f3f;
const lint LINF = 0x3f3f3f3f3f3f3f3fll;
const double EPS = 1e-6;

bool equals(double a,double b) { return fabs(a-b) < EPS; }

int main() {
    int n;
    scanf("%d",&n);
    int ans = 0;
    int qntd = 0, free = 0;
    for(int a=0;a<2*n;++a) {
        int q;
        scanf("%*d.%d",&q);
        if(!q) ++free;
        else {
            ans += q;
            ++qntd;
        }
    }
    int able = min(qntd,n), needs = max(0,n-free);
    able -= needs;
    ans -= 1000*needs;
    if(ans >= 1000*able) ans -= 1000*able;
    else {
        able -= ans/1000;
        ans %= 1000;
        if(able && ans > 1000-ans) ans = 1000-ans;
    }
    ans = abs(ans);
    printf("%d.%3d\n",ans/1000,ans%1000);
    return 0;
}


#ifndef DEBUG
//https://github.com/boleynsu/acmicpc-codes/blob/master/templates/Core.hpp
/*
 * Package: StandardCodeLibrary.Core
 * */
//引进常用的头文件并使用std名字空间;
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <utility>
#include <vector>
#include <list>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <bitset>
#include <complex>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <climits>
using namespace std;

//用于减少代码量的宏;
#define lp for(;;)
#define repf(i,a,b) for (int i=(a);i<(b);++i)
#define ft(i,a,b) for (int i=(a);i<=(b);++i)
#define fdt(i,a,b) for (int i=(a);i>=(b);--i)
#define rrepf(i,a,b) fdt(i,(a)-1,b)
#define rep(i,n) repf(i,0,n)
#define rrep(i,n) rrepf(i,n,0)
#define for_nonempty_subsets(subset,set) for (int subset=set;subset;subset=(subset-1)&(set))
#define for_in_charset(i,charset) for (cstr i=(charset);*i;i++)
#define whl while
#define rtn return
#define fl(x,y) memset((x),char(y),sizeof(x))
#define clr(x) fl(x,char(0))
#define cpy(x,y) memcpy(x,y,sizeof(x))
#define sf scanf
#define pf printf
#define vec vector
#define pr pair
#define que queue
#define prq priority_queue
#define itr iterator
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define ins insert
#define ers erase
#define lb lower_bound
#define ub upper_bound
#define rnk order_of_key
#define sel find_by_order
#define sz(x) (int((x).size()))
#define all(x) (x).begin(),(x).end()
#define srt(x) sort(all(x))
#define uniq(x) srt(x),(x).erase(unique(all(x)),(x).end())
#define rev(x) reverse(all(x))
#define shf(x) random_shuffle(all(x))
#define nxtp(x) next_permutation(all(x))

//调试相关的宏;
#ifndef DEBUG
#define prt(x) (cerr)
#define asrtWA(s) do if(!(s))exit(0);whl(0)
#define asrtTLE(s) do if(!(s))whl(1);whl(0)
#define asrtMLE(s) do if(!(s))whl(new int);whl(0)
#define asrtOLE(s) do if(!(s))whl(1)puts("OLE");whl(0)
#define asrtRE(s) do if(!(s))*(int*)0=0;whl(0)
#define runtime() (cerr)
#define input(in) freopen(in,"r",stdin)
#define output(out) freopen(out,"w",stdout)
#else
#define prt(x) cerr<<"第"<<__LINE__<<"行\t: "<<#x"\t="<<(x)<<endl
#define asrtWA(s) do if(!(s))cerr<<"assert("#s")"<<endl;whl(0)
#define asrtTLE(s) do if(!(s))cerr<<"assert("#s")"<<endl;whl(0)
#define asrtMLE(s) do if(!(s))cerr<<"assert("#s")"<<endl;whl(0)
#define asrtOLE(s) do if(!(s))cerr<<"assert("#s")"<<endl;whl(0)
#define asrtRE(s) do if(!(s))cerr<<"assert("#s")"<<endl;whl(0)
#define runtime() cerr<<"Used: "<<db(clock())/CLOCKS_PER_SEC<<"s"<<endl
#define input(in)
#define output(out)
#endif

//常用数据类型;
typedef long long int lli;
typedef double db;
typedef const char* cstr;
typedef string str;
typedef vec<int> vi;
typedef vec<vi> vvi;
typedef vec<lli> vl;
typedef vec<vl> vvl;
typedef vec<bool> vb;
typedef vec<vb> vvb;
typedef vec<char> vc;
typedef vec<vc> vvc;
typedef vec<str> vs;
typedef pr<int,int> pii;
typedef pr<lli,lli> pll;
typedef pr<db,db> pdd;
typedef vec<pii> vpii;
typedef vec<pll> vpll;
typedef vec<pdd> vpdd;
typedef map<int,int> mii;
typedef map<str,int> msi;
typedef map<char,int> mci;
typedef set<int> si;
typedef set<str> ss;
typedef que<int> qi;

//常用常量:int的最大值;lli的最大值;db的误差相关常数;欧拉常数;圆周率;移动向量;取模使用的除数;
int oo=(~0u)>>1;
lli ooll=(~0ull)>>1;
db inf=1e+10;
db eps=1e-10;
db gam=0.5772156649015328606;
db pi=acos(-1.0);
int dx[]={1,0,-1,0,1,-1,-1,1,0};
int dy[]={0,1,0,-1,1,1,-1,-1,0};
int MOD=1000000007;

//常用函数:最大最小值更新;数学相关函数;输入和输出;树状数组;并查集;可合并堆;
template<typename type>inline bool cmax(type& a,const type& b){rtn a<b?a=b,true:false;}
template<typename type>inline bool cmin(type& a,const type& b){rtn b<a?a=b,true:false;}
template<typename type>inline type sqr(const type& x){rtn x*x;}
template<typename type>inline type mod(const type& x){rtn x%MOD;}
inline int sgn(const db& x){rtn (x>+eps)-(x<-eps);}
inline int dbcmp(const db& a,const db& b){rtn sgn(a-b);}
template<typename type>inline pr<type,type> operator-(const pr<type,type>& x){rtn mp(-x.x,-x.y);}
template<typename type>inline pr<type,type> operator+(const pr<type,type>& a,const pr<type,type>& b){rtn mp(a.x+b.x,a.y+b.y);}
template<typename type>inline pr<type,type> operator-(const pr<type,type>& a,const pr<type,type>& b){rtn mp(a.x-b.x,a.y-b.y);}
template<typename type>inline pr<type,type> operator*(const pr<type,type>& a,const type& b){rtn mp(a.x*b,a.y*b);}
template<typename type>inline pr<type,type> operator/(const pr<type,type>& a,const type& b){rtn mp(a.x/b,a.y/b);}
template<typename type>inline pr<type,type>& operator-=(pr<type,type>& a,const pr<type,type>& b){rtn a=a-b;}
template<typename type>inline pr<type,type>& operator+=(pr<type,type>& a,const pr<type,type>& b){rtn a=a+b;}
template<typename type>inline pr<type,type>& operator*=(pr<type,type>& a,const type& b){rtn a=a*b;}
template<typename type>inline pr<type,type>& operator/=(pr<type,type>& a,const type& b){rtn a=a/b;}
template<typename type>inline type cross(const pr<type,type>& a,const pr<type,type>& b){rtn a.x*b.y-a.y*b.x;}
template<typename type>inline type dot(const pr<type,type>& a,const pr<type,type>& b){rtn a.x*b.x+a.y*b.y;}
template<typename type>inline type gcd(type a,type b){if(b)whl((a%=b)&&(b%=a));rtn a+b;}
template<typename type>inline type lcm(type a,type b){rtn a*b/gcd(a,b);}
inline lli bin_pow(lli x,lli y){lli z=1;whl(y){if(y&1)z=mod(z*x);x=mod(sqr(x)),y>>=1;}rtn z;}
template<typename istream,typename first_type,typename second_type>inline istream& operator>>(istream& cin,pr<first_type,second_type>& x){rtn cin>>x.x>>x.y;}
template<typename ostream,typename first_type,typename second_type>inline ostream& operator<<(ostream& cout,const pr<first_type,second_type>& x){rtn cout<<x.x<<" "<<x.y;}
template<typename istream,typename type>inline istream& operator>>(istream& cin,vec<type>& x){rep(i,sz(x))cin>>x[i];rtn cin;}
template<typename ostream,typename type>inline ostream& operator<<(ostream& cout,const vec<type>& x){rep(i,sz(x))cout<<x[i]<<(i+1==sz(x)?"":" ");rtn cout;}
inline ostream& pdb(int prcs,db x){rtn cout<<setprecision(prcs)<<fixed<<(sgn(x)?(x):0);}
template<typename type>inline void bit_inc(vec<type>& st,int x,type inc){whl(x<sz(st))st[x]+=inc,x|=x+1;}
template<typename type>inline type bit_sum(const vec<type>& st,int x){type s=0;whl(x>=0)s+=st[x],x=(x&(x+1))-1;rtn s;}
template<typename type>inline type bit_kth(const vec<type>& st,int k){int x=0,y=0,z=0;whl((1<<(++y))<=sz(st));rrep(i,y){if((x+=1<<i)>sz(st)||z+st[x-1]>k)x-=1<<i;else z+=st[x-1];}rtn x;}
inline void make_set(vi& st){rep(i,sz(st))st[i]=i;}
inline int find_set(vi& st,int x){int y=x,z;whl(y!=st[y])y=st[y];whl(x!=st[x])z=st[x],st[x]=y,x=z;rtn y;}
inline bool union_set(vi& st,int a,int b){a=find_set(st,a),b=find_set(st,b);rtn a!=b?st[a]=b,true:false;}
inline void make_set(vpii& st){rep(i,sz(st))st[i]=mp(i,1);}
inline int find_set(vpii& st,int x){int y=x,z;whl(y!=st[y].x)y=st[y].x;whl(x!=st[x].x)z=st[x].x,st[x].x=y,x=z;rtn y;}
inline bool union_set(vpii& st,int a,int b){a=find_set(st,a),b=find_set(st,b);rtn a!=b?(st[a].y>st[b].y?st[a].x=b,st[a].y+=st[b].y:st[b].x=a,st[b].y+=st[a].y),true:false;}
template<typename type>inline void merge(type& a,type& b){if(sz(a)<sz(b))swap(a,b);whl(sz(b))a.ins(*b.begin()),b.ers(b.begin());}

//初始化;
struct Initializer{
#ifndef DEBUG
Initializer(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);}
#else
~Initializer(){runtime();}
#endif
}initializer;

//非标准;
#define for_each(e,s) for (__typeof__((s).begin()) e=(s).begin();e!=(s).end();++e)
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/tag_and_trait.hpp>
typedef __gnu_cxx::rope<char> rope;
template<typename key,typename value>class ext_map:public __gnu_pbds::tree<key,value,less<key>,__gnu_pbds::rb_tree_tag,__gnu_pbds::tree_order_statistics_node_update>{};
#define ctz __builtin_ctz
#define clz __builtin_clz
#define bc __builtin_popcount
#else
//上面部分的代码生成的Precompiled Headers
#include <Core>
#endif

int main()
{
	int n;
	sf("%d",&n);
	int sum=0,cnt=0;
	rep(i,n*2)
	{
		int x,y;
		sf("%d.%d",&x,&y);
		sum+=y;
		if (y) cnt++;
	}prt(sum),prt(cnt);
	int ans=+oo;
	ft(i,0,n)
	{
		int a=i,b=n-i;
		if (a<=cnt&&b<=n*2-cnt)
			cmin(ans,abs(sum-a*1000));
	}
	printf("%d.%03d\n",ans/1000,ans%1000);
}


#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>

#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>

using namespace std;

typedef long long int64;

const double oo = 1e15;
const double EPS = 1e-9;
const int MAX_N = 4005;

int N, A[MAX_N], Solution;

inline int Round(const double value) {
    return int(value + 0.5);
}

inline int GetSum(const int left, const int right) {
    int sum = (right - left + 1) * 1000 / 2;
    for (int i = left; i <= right; ++i)
        sum -= A[i];
    return sum;
}

inline int GetSum(int sum) {
    if (sum < 0)
        sum = -sum;
    return sum;
}

void Solve() {
    sort(A, A + N);
    int zero = 0;
    for (; zero < N && A[zero] == 0; ++zero);
    if (zero % 2 == 0) {
        Solution = GetSum(GetSum(zero, N - 1));
    } else {
        Solution = min(GetSum(zero + 1, N - 1) + 1000 - A[zero], GetSum(zero + 1, N - 1) - A[zero]);
    }
}

void Read() {
    cin >> N;
    N *= 2;
    for (int i = 0; i < N; ++i) {
        double value;
        cin >> value;
        A[i] = Round(1000 * value) % 1000;
    }
}

void Print() {
    printf("0.%03d\n", Solution);
}

int main() {
    #ifndef ONLINE_JUDGE
        assert(freopen("a.in", "r", stdin));
        assert(freopen("a.out", "w", stdout));
    #endif
    Read();
    Solve();
    Print();
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>

#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>

using namespace std;

typedef long long int64;

const double oo = 1e15;
const double EPS = 1e-9;
const int MAX_N = 4005;

int N, A[MAX_N], Solution;

inline int Round(const double value) {
    return int(value + 0.5);
}

inline int GetSum(const int left, const int right) {
    int sum = (right - left + 1) * 1000 / 2;
    for (int i = left; i <= right; ++i)
        sum -= A[i];
    return sum;
}

inline int GetSum(int sum) {
    if (sum < 0)
        sum = -sum;
    return sum;
}

void Solve() {
    Solution = 1000;
    sort(A, A + N);
    int zero = 0;
    for (; zero < N && A[zero] == 0; ++zero);
    for (int plusZero = 0; plusZero <= zero; ++plusZero) {
        int minusZero = zero - plusZero;
        int plus = N / 2 - plusZero, minus = N / 2 - minusZero;
        if (plus < 0 || minus < 0)
            continue;
        int sum = plus * 1000;
        for (int i = zero; i < N; ++i)
            sum -= A[i];
        if (sum < 0)
            sum = -sum;
        Solution = min(Solution, sum);
    }
}

void Read() {
    cin >> N;
    N *= 2;
    for (int i = 0; i < N; ++i) {
        double value;
        cin >> value;
        A[i] = Round(1000 * value) % 1000;
    }
}

void Print() {
    printf("0.%03d\n", Solution);
}

int main() {
    #ifndef ONLINE_JUDGE
        assert(freopen("a.in", "r", stdin));
        assert(freopen("a.out", "w", stdout));
    #endif
    Read();
    Solve();
    Print();
    return 0;
}


#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>

#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>

using namespace std;

typedef long long int64;

const int oo = 0x3f3f3f3f;
const double EPS = 1e-9;
const int MAX_N = 4005;

int N, A[MAX_N], Solution;

inline int Round(const double value) {
    return int(value + 0.5);
}

inline int GetSum(const int left, const int right) {
    int sum = (right - left + 1) * 1000 / 2;
    for (int i = left; i <= right; ++i)
        sum -= A[i];
    return sum;
}

inline int GetSum(int sum) {
    if (sum < 0)
        sum = -sum;
    return sum;
}

void Solve() {
    Solution = oo;
    sort(A, A + N);
    int zero = 0;
    for (; zero < N && A[zero] == 0; ++zero);
    for (int plusZero = 0; plusZero <= zero; ++plusZero) {
        int minusZero = zero - plusZero;
        int plus = N / 2 - plusZero, minus = N / 2 - minusZero;
        if (plus < 0 || minus < 0)
            continue;
        int sum = plus * 1000;
        for (int i = zero; i < N; ++i)
            sum -= A[i];
        if (sum < 0)
            sum = -sum;
        Solution = min(Solution, sum);
    }
}

void Read() {
    cin >> N;
    N *= 2;
    for (int i = 0; i < N; ++i) {
        double value;
        cin >> value;
        A[i] = Round(1000 * value) % 1000;
    }
}

void Print() {
    printf("%d.%03d\n", Solution / 1000, Solution % 1000);
}

int main() {
    #ifndef ONLINE_JUDGE
        assert(freopen("a.in", "r", stdin));
        assert(freopen("a.out", "w", stdout));
    #endif
    Read();
    Solve();
    Print();
    return 0;
}


/*
 Author:   Harhro94 [Harutyunyan Hrayr]
 IDE:      Visual C++ 2012
*/
//#pragma comment(linker, "/STACK:66777216")
#define _CRT_SECURE_NO_WARNINGS
#include <functional>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cassert>
#include <iomanip>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <ctime>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
using namespace std;

typedef long long LL;
typedef long double LD;
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()

const int N = 4007;
LD a[N];
int b[N], pref[N], suff[N];

int main()
{
#ifdef harhro94
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen(task".out", "w", stdout);
#endif

    int n;
    cin >> n;
    n *= 2;
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        a[i] += 1e-6;
        a[i] *= 1000;
        b[i] = (int)a[i] % 1000;
    }
    sort(b, b + n);
    for (int i = 0; i < n; ++i)
    {
        pref[i] = b[i];
        if (i) pref[i] += pref[i - 1];
    }
    for (int i = n - 1; i >= 0; --i)
    {
        if (b[i] == 0) suff[i] = suff[i + 1];
        else suff[i] = suff[i + 1] + 1000 - b[i];
    }
    int ans = abs(suff[0]);
    ans = min(ans, abs(pref[n - 1]));
    for (int i = 0; i < n; ++i)
        ans = min(ans, abs(suff[i + 1] - pref[i]));
    cout << fixed << setprecision(3) << ans / 1000.0 << endl;

#ifdef harhro94
    cerr << fixed << setprecision(3) << "\nExecution time = " << clock() / 1000.0 << "s\n";
#endif
    return 0;
}


/*
 Author:   Harhro94 [Harutyunyan Hrayr]
 IDE:      Visual C++ 2012
*/
//#pragma comment(linker, "/STACK:66777216")
#define _CRT_SECURE_NO_WARNINGS
#include <functional>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cassert>
#include <iomanip>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <ctime>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
using namespace std;

typedef long long LL;
typedef long double LD;
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()

const int N = 4007;
LD a[N];
int b[N];

int main()
{
#ifdef harhro94
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen(task".out", "w", stdout);
#endif

    int n;
    cin >> n;
    n *= 2;
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        a[i] += 1e-9;
        a[i] *= 1000;
        b[i] = (int)a[i] % 1000;
    }
    sort(b, b + n);
    int ans = 0;
    for (int i = n - 1; i >= 0; i -= 2)
    {
        ans += b[i];
        if (b[i - 1] != 0) ans -= 1000 - b[i - 1];
    }
    cout << fixed << setprecision(3) << abs(ans) / 1000.0 << endl;

#ifdef harhro94
    cerr << fixed << setprecision(3) << "\nExecution time = " << clock() / 1000.0 << "s\n";
#endif
    return 0;
}


/*
 Author:   Harhro94 [Harutyunyan Hrayr]
 IDE:      Visual C++ 2012
*/
//#pragma comment(linker, "/STACK:66777216")
#define _CRT_SECURE_NO_WARNINGS
#include <functional>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cassert>
#include <iomanip>
#include <cstring>
#include <cstdio>
#include <string>
#include <bitset>
#include <vector>
#include <ctime>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
using namespace std;

typedef unsigned long long ULL;
typedef long long LL;
typedef long double LD;
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()

int main()
{
#ifdef harhro94
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#else
    //freopen(task".in", "r", stdin);
    //freopen(task".out", "w", stdout);
#endif

    int n;
    cin >> n;
    n <<= 1;
    int sum = 0;
    int integer = 0;
    for(int i = 0; i < n; ++i)
    {
        LD x;
        cin >> x;
        x += 1e-7;
        x *= 1000.0;
        int a = (int)x;
        a %= 1000;
        if (a == 0) ++integer;
        else sum += a;
    }
    int ans = 1000000000;
    for(int i = 0; i <= n / 2; ++i)
    {
        if (n / 2 - i > integer) continue;
        int diff = abs(i * 1000 - sum);
        if (diff < ans) ans = diff;
    }
    cout << fixed << setprecision(3) << ans / 1000.0 << endl;

#ifdef harhro94
    cerr << fixed << setprecision(3) << "\nExecution time = " << clock() / 1000.0 << "s\n";
#endif
    return 0;
}


/*
 Author:   Harhro94 [Harutyunyan Hrayr]
 IDE:      Visual C++ 2012
*/
//#pragma comment(linker, "/STACK:66777216")
#define _CRT_SECURE_NO_WARNINGS
#include <functional>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cassert>
#include <iomanip>
#include <cstring>
#include <cstdio>
#include <string>
#include <bitset>
#include <vector>
#include <ctime>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
using namespace std;

typedef unsigned long long ULL;
typedef long long LL;
typedef long double LD;
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()

int main()
{
#ifdef harhro94
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#else
    //freopen(task".in", "r", stdin);
    //freopen(task".out", "w", stdout);
#endif

    int n;
    cin >> n;
    n <<= 1;
    int can = n;
    int sum = 0;
    for(int i = 0; i < n; ++i)
    {
        LD x;
        cin >> x;
        x += 1e-7;
        x *= 1000.0;
        int a = (int)x;
        a %= 1000;
        if (a == 0) --can;
        else sum += a;
    }
    int ans = 1000000000;
    for(int i = 0; i <= can; ++i)
    {
        int diff = abs(i * 1000 - sum);
        if (diff < ans) ans = diff;
    }
    cout << fixed << setprecision(3) << ans / 1000.0 << endl;

#ifdef harhro94
    cerr << fixed << setprecision(3) << "\nExecution time = " << clock() / 1000.0 << "s\n";
#endif
    return 0;
}


#include <bits/stdc++.h>
typedef long long int64;
#define long int64
#define scanf error
#define printf error
#define to_string "std::string disabled, mingw32-4.7 bug, using windows for a server is lame"

using namespace std;

//=========================================================
// program:
//

// in:
string a[4000];
int n2;

int x[4000];

string solve()
{
    int n = n2 * 2;
    for (int i=0; i<n; i++) {
        istringstream st( a[i] );
        int z=-1, f=-1; char ch;
        st >> z >> ch >> f;
        x[i] = f; // only the modulo , the decimal digits matters
    }
    sort(x, x + n);
    int z = 0; //count zeros
    while ( (z < n) && (x[z] == 0) ) {
        z++;
    }
    //cout << z << " | ";
    //for (int i=z; i<n; i++) cout << x[i] << " "; cout << endl;
    int res = 0;
    int i = z;
    int j = n - 1;
    while (i < j) {
        res -= x[i];
        res += 1000 - x[j];
        i++; j--;
        //cout<< "*" << res << endl;
    }
    if (i == j) {
        res = std::min<int>( abs(res - x[i]), abs(res + 1000 - x[i] ) );
    }

    res = abs(res);

    /*if (n <= 20) { //brute
        int res2 = 1000000000;
        for (int mask = 0; mask < (1<<n); mask++) {
            int r = 0;
            int c = 0;
            for (int i=0; i<n; i++) {
                if (mask & (1<<i)) {
                    c++;
                    r -= x[i];
                } else {
                    if (x[i] != 0) {
                        r += 1000 - x[i];
                    }
                }
            }
            if (c == n2) {
                r = abs(r);
                res2 = min(res2, r);
            }
        }
        if (res != res2) {
            cout << n2<<endl;
            for (int i=0; i<n; i++) {
                cout << (i?" ":"") << ""<<a[i]<<"";
            }
            cout << endl;
            cout << "res2="<<res2<<"; res="<<res<<endl;
        }
        assert(res == res2);
    }*/

    //
    ostringstream st;
    st << res / 1000 << ".";
    st.width(3);
    st.fill('0');
    st << (res % 1000);

    return st.str();
}

inline void init(){}
//=========================================================
// I/O:
//
int main()
{
    ios::sync_with_stdio(0);
    init();

    /*srand('v'*'x');
    for (int ITER=  1000; ITER >= 0; ITER--) {
        n2 = 10;
        for (int i=0; i<2*n2; i++) {
            int d = rand()%1000;
            ostringstream st;
            st << "0."; st.width(3); st.fill('0'); st << d;
            a[i] = st.str();
        }
        solve();
        //cout << solve() << endl;
    }*/

    bool prev = false;
    while( cin >> n2) {
        if (prev) {
            cout << endl;
        }
        prev = true;
        for (int i=0; i<2*n2; i++) {
            cin >> a[i];
        }
        cout << solve() << endl;
    }
    return 0;
}


#include <bits/stdc++.h>
typedef long long int64;
#define long int64
#define scanf error
#define printf error
#define to_string "std::string disabled, mingw32-4.7 bug, using windows for a server is lame"

using namespace std;

//=========================================================
// program:
//

// in:
string a[4000];
int n2;

int x[4000];

string solve()
{
    int n = n2 * 2;
    for (int i=0; i<n; i++) {
        istringstream st( a[i] );
        int z=-1, f=-1; char ch;
        st >> z >> ch >> f;
        x[i] = f; // only the modulo , the decimal digits matters
    }
    sort(x, x + n);
    int z = 0; //count zeros
    while ( (z < n) && (x[z] == 0) ) {
        z++;
    }
    //cout << z << " | ";
    //for (int i=z; i<n; i++) cout << x[i] << " "; cout << endl;

    int res = 5000000;
    int sum = accumulate(x, x+n, 0);

    // how many zeros will be ceil?
    for (int i = 0; i <= z && i <= n2; i++) {
        res = min(res, abs( (n2 - i) * 1000 - sum ) );
    }

    /*if (n <= 22) { //brute
        int res2 = 1000000000;
        int perm[n];
        for (int i = 0; i < n; i++) {
            perm[i] = (i >= n2);
        }
        do {
            int r = 0;
            int c = 0;
            for (int i=0; i<n; i++) {
                if ( perm[i] ) {
                    r -= x[i];
                } else {
                    if (x[i] != 0) {
                        r += 1000 - x[i];
                    }
                }
            }
            r = abs(r);
            res2 = min(res2, r);
        } while (next_permutation(perm, perm+n));
        if (res != res2) {
            cout << n2<<endl;
            for (int i=0; i<n; i++) {
                cout << (i?" ":"") << ""<<a[i]<<"";
            }
            cout << endl;
            cout << "res2="<<res2<<"; res="<<res<<endl;
        }
        assert(res == res2);
    }*/

    //
    ostringstream st;
    st << res / 1000 << ".";
    st.width(3);
    st.fill('0');
    st << (res % 1000);

    return st.str();
}

inline void init(){}
//=========================================================
// I/O:
//
int main()
{
    ios::sync_with_stdio(0);
    init();

    /*srand('v'*'x');
    for (int ITER=  1000; ITER >= 0; ITER--) {
        n2 = 11;
        for (int i=0; i<2*n2; i++) {
            int d = rand()%1000;
            ostringstream st;
            st << "0."; st.width(3); st.fill('0'); st << d;
            a[i] = st.str();
        }
        solve();
        //cout << solve() << endl;
    }*/

    bool prev = false;
    while( cin >> n2) {
        if (prev) {
            cout << endl;
        }
        prev = true;
        for (int i=0; i<2*n2; i++) {
            cin >> a[i];
        }
        cout << solve() << endl;
    }
    return 0;
}


#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    ll n;
    cin>>n;
    vector<ld> v(n<<1);
    ll q=n;
    ld sum=0;
    for(ll i=0; i<2*n; ++i) {
        cin>>v[i];
        /*
        if(!(v[i]-((ll)v[i]))) {
            ++q;
        }
        */
    }
    ll qq=q;

    for(ll i=0; i<2*n; ++i) {
        if(v[i]-((ll)v[i])) {
            if(!q) {
                sum-=1;
            }
            else --q;
            sum+=v[i]-((ll)v[i]);
        }
    }
    ld p=sum;

    for(ll i=0; i<q; ++i) {
        --sum;
        if(abs(sum)<p) p=abs(sum);
    }
    cout<<fixed;
    cout<<setprecision(3)<<p<<'\n';

}


#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    ll n;
    cin>>n;
    vector<ld> v(n<<1);
    ll q=n;
    ld sum=0;
    for(ll i=0; i<2*n; ++i) {
        cin>>v[i];
    }
    ll qq=q;

    for(ll i=0; i<2*n; ++i) {
        if(v[i]-((ll)v[i])) {
            if(!q) {
                sum-=1;
            }
            else --q;
            sum+=v[i]-((ll)v[i]);
        }
    }
    ld p=sum;

    for(ll i=0; i<n; ++i) {
        --sum;
        if(abs(sum)<abs(p)) p=abs(sum);
    }
    cout<<fixed;
    cout<<setprecision(3)<<abs(p)<<'\n';

}


#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    ll n;
    cin>>n;
    vector<ld> v(n<<1);
    ll q=0;
    ld sum=0;
    for(ll i=0; i<2*n; ++i) {
        cin>>v[i];
        if(v[i]-((ll)v[i])) {
            ++q;
            sum+=v[i]-((ll)v[i]);
            //sum+=v[i];
        }

    }
    ld p=sum;
    for(ll i=0; i<n; ++i) {
        --sum;
        if(abs(sum)<p) p=abs(sum);
    }
    cout<<fixed;
    cout<<setprecision(3)<<p<<'\n';

}


#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    ll n;
    cin>>n;
    vector<ld> v(n<<1);
    ll q=n;
    ld sum=0;
    for(ll i=0; i<2*n; ++i) {
        cin>>v[i];
    }
    ll qq=q;

    for(ll i=0; i<2*n; ++i) {
        if(v[i]-((ll)v[i])) {
            if(!q) {
                sum-=1;
            }
            else --q;
            sum+=v[i]-((ll)v[i]);
        }
    }
    ld p=sum;

    for(ll i=0; i<n; ++i) {
        --sum;
        if(abs(sum)<p) p=abs(sum);
    }
    cout<<fixed;
    cout<<setprecision(3)<<p<<'\n';

}


#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    ll n;
    cin>>n;
    vector<ld> v(n<<1);
    ll q=n;
    ld sum=0;
    for(ll i=0; i<2*n; ++i) {
        cin>>v[i];
    }
    ll qq=q;

    ll y=0;
    ll a=0;
    for(ll i=0; i<2*n; ++i) {
        if(v[i]-((ll)v[i])) {
            if(!q) {
                sum-=1;
                ++a;
            }
            else --q,++y;
            sum+=v[i]-((ll)v[i]);
        }
    }
    ld p=sum;

    for(ll i=0; i<n && y>0 && a<n; ++i) {
        --sum;
        --y;
        ++a;
        if(abs(sum)<abs(p)) p=abs(sum);
    }
    cout<<fixed;
    cout<<setprecision(3)<<abs(p)<<'\n';

}


#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    ll n;
    cin>>n;
    vector<ld> v(n<<1);
    ll q=n;
    ld sum=0;
    for(ll i=0; i<2*n; ++i) {
        cin>>v[i];
    }
    ll qq=q;

    for(ll i=0; i<2*n; ++i) {
        if(v[i]-((ll)v[i])) {
            if(!q) {
                sum-=1;
            }
            else --q;
            sum+=v[i]-((ll)v[i]);
        }
    }
    ld p=abs(sum);

    for(ll i=0; i<n; ++i) {
        --sum;
        if(abs(sum)<p) p=abs(sum);
    }
    cout<<fixed;
    cout<<setprecision(3)<<abs(p)<<'\n';

}


#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    ll n;
    cin>>n;
    vector<ld> v(n<<1);
    ll q=n;
    ld sum=0;
    for(ll i=0; i<2*n; ++i) {
        cin>>v[i];
    }
    ll qq=q;

    for(ll i=0; i<2*n; ++i) {
        if(v[i]-((ll)v[i])) {
            if(!q) {
                sum-=1;
            }
            else --q;
            sum+=v[i]-((ll)v[i]);
        }
    }
    ld p=sum;

    for(ll i=0; i<n; ++i) {
        --sum;
        if(abs(sum)<p) p=abs(sum);
    }
    cout<<fixed;
    cout<<setprecision(3)<<abs(p)<<'\n';

}


#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    ll n;
    cin>>n;
    vector<ld> v(n<<1);
    ll q=0;
    ld sum=0;
    for(ll i=0; i<2*n; ++i) {
        cin>>v[i];
        if(v[i]-((ll)v[i])) {
            ++q;
            sum+=v[i]-((ll)v[i]);
        }

    }
    sum=abs(sum);
    sum-=(ll)sum;
    cout<<fixed;
    cout<<setprecision(3)<<min(abs(sum), abs(1-sum))<<'\n';

}


#include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

int abs(int a) {
    return max(a, -a);
}

int main() {
    int n;
    cin >> n;
    n *= 2;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
        double x;
        cin >> x;
        if (x >= 0) {
            v[i] = x * 1000.0 + 0.1;
            v[i] = v[i] % 1000;
        } else {
            v[i] = - x * 1000.0 + 0.1;
            v[i] = 1000 - v[i] % 1000;
        }
    }
    int sum = 0;
    int count = 0;
    for (int i = 0; i < n; ++i) {
        sum += v[i];
        if (v[i] != 0)
            ++count;
    }
    int minimum = 1000 * 1000 * 1000;
    for (int i = max(0, count - n / 2); i <= min(n / 2, count); ++i) {
        minimum = min(minimum, abs(1000 * i - sum));
    }
    printf("%.3f", minimum / 1000.0);
//    cout << minimum / 1000 << '.' << minimum % 1000 / 100 << minimum % 100 / 10 << minimum % 10;
}


#include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

int abs(int a) {
    return max(a, -a);
}

int main() {
    int n;
    cin >> n;
    n *= 2;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
        double x;
        cin >> x;
        if (x >= 0) {
            v[i] = x * 1000.0 + 0.1;
            v[i] = v[i] % 1000;
        } else {
            v[i] = - x * 1000.0 + 0.1;
            v[i] = 1000 - v[i] % 1000;
        }
    }
    int sum = 0;
    int count = 0;
    for (int i = 0; i < n; ++i) {
        sum += v[i];
        if (v[i] == 0)
            ++count;
    }
    int minimum = sum;
    for (int i = 0; i <= n / 2; ++i) {
        minimum = min(minimum, abs(1000 * i - sum));
    }
    printf("%.3f", minimum / 1000.0);
//    cout << minimum / 1000 << '.' << minimum % 1000 / 100 << minimum % 100 / 10 << minimum % 10;
}


#include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

int abs(int a) {
    return max(a, -a);
}

int main() {
    int n;
    cin >> n;
    n *= 2;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
        double x;
        cin >> x;
        if (x >= 0) {
            v[i] = x * 1000.0 + 0.1;
            v[i] = v[i] % 1000;
        } else {
            v[i] = - x * 1000.0 + 0.1;
            v[i] = 1000 - v[i] % 1000;
        }
    }
    int sum = 0;
    int count = 0;
    for (int i = 0; i < n; ++i) {
        sum += v[i];
        if (v[i] == 0)
            ++count;
    }
    int minimum = sum;
    for (int i = 0; i <= min(n / 2, n - count); ++i) {
        minimum = min(minimum, abs(1000 * i - sum));
    }
    printf("%.3f", minimum / 1000.0);
//    cout << minimum / 1000 << '.' << minimum % 1000 / 100 << minimum % 100 / 10 << minimum % 10;
}


#include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

int abs(int a) {
    return max(a, -a);
}

int main() {
    int n;
    cin >> n;
    n *= 2;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
        double x;
        cin >> x;
        if (x >= 0) {
            v[i] = x * 1000.0 + 0.1;
            v[i] = v[i] % 1000;
        } else {
            v[i] = - x * 1000.0 + 0.1;
            v[i] = 1000 - v[i] % 1000;
        }
    }
    int sum = 0;
    int count = 0;
    for (int i = 0; i < n; ++i) {
        sum += v[i];
        if (v[i] != 0)
            ++count;
    }
    int minimum = sum;
    for (int i = max(0, count - n / 2); i <= min(n / 2, count); ++i) {
        minimum = min(minimum, abs(sum - 1000 * i));
    }
    printf("%.3f", minimum / 1000.0);
//    cout << minimum / 1000 << '.' << minimum % 1000 / 100 << minimum % 100 / 10 << minimum % 10;
}


#include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

int abs(int a) {
    return max(a, -a);
}

int main() {
    int n;
    cin >> n;
    n *= 2;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
        double x;
        cin >> x;
        if (x >= 0) {
            v[i] = x * 1000;
            v[i] = v[i] % 1000;
        } else {
            v[i] = - x * 1000;
            v[i] = 1000 - v[i] % 1000;
        }
    }
    int sum = 0;
    int count = 0;
    for (int i = 0; i < n; ++i) {
        sum += v[i];
        if (v[i] == 0)
            ++count;
    }
    int minimum = sum;
    for (int i = 0; i <= n / 2; ++i) {
        minimum = min(minimum, abs(1000 * i - sum));
    }
    printf("%.3f", minimum / 1000.0);
//    cout << minimum / 1000 << '.' << minimum % 1000 / 100 << minimum % 100 / 10 << minimum % 10;
}


#include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

int abs(int a) {
    return max(a, -a);
}

int main() {
    int n;
    cin >> n;
    n *= 2;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
        double x;
        cin >> x;
        if (x >= 0) {
            v[i] = x * 1000.0 + 0.1;
            v[i] = v[i] % 1000;
        } else {
            v[i] = - x * 1000.0 + 0.1;
            v[i] = 1000 - v[i] % 1000;
        }
    }
    int sum = 0;
    int count = 0;
    for (int i = 0; i < n; ++i) {
        sum += v[i];
        if (v[i] != 0)
            ++count;
    }
    int minimum = sum;
    for (int i = max(0, count - n / 2); i <= min(n / 2, count); ++i) {
        minimum = min(minimum, abs(1000 * i - sum));
    }
    printf("%.3f", minimum / 1000.0);
//    cout << minimum / 1000 << '.' << minimum % 1000 / 100 << minimum % 100 / 10 << minimum % 10;
}


#include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

int abs(int a) {
    return max(a, -a);
}

int main() {
    int n;
    cin >> n;
    n *= 2;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
        double x;
        cin >> x;
        if (x >= 0) {
            v[i] = x * 1000.0 + 0.1;
            v[i] = v[i] % 1000;
        } else {
            v[i] = - x * 1000.0 + 0.1;
            v[i] = 1000 - v[i] % 1000;
        }
    }
    int sum = 0;
    int count = 0;
    for (int i = 0; i < n; ++i) {
        sum += v[i];
        if (v[i] >= 500)
            ++count;
    }
    int minimum = sum;
    for (int i = 0; i <= min(n / 2, count); ++i) {
        minimum = min(minimum, abs(1000 * i - sum));
    }
    printf("%.3f", minimum / 1000.0);
//    cout << minimum / 1000 << '.' << minimum % 1000 / 100 << minimum % 100 / 10 << minimum % 10;
}


#include <iostream>
#include <vector>
#include <cstdio>

using namespace std;

int abs(int a) {
    return max(a, -a);
}

int main() {
    int n;
    cin >> n;
    n *= 2;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
        double x;
        cin >> x;
        if (x >= 0) {
            v[i] = x * 1000;
            v[i] = v[i] % 1000;
        } else {
            v[i] = - x * 1000;
            v[i] = 1000 - v[i] % 1000;
        }
    }
    int sum = 0;
    int count = 0;
    for (int i = 0; i < n; ++i) {
        sum += v[i];
        if (v[i] == 0)
            ++count;
    }
    int minimum = sum;
    for (int i = 0; i < n / 2; ++i) {
        minimum = min(minimum, abs(1000 * i - sum));
    }
    printf("%.3f", minimum / 1000.0);
//    cout << minimum / 1000 << '.' << minimum % 1000 / 100 << minimum % 100 / 10 << minimum % 10;
}


// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <iomanip>
#define dibs reserve
#define OVER9000 1234567890
#define tisic 47
#define soclose 10e-7
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define chocolate win
#define ff first
#define ss second
// mylittlepony
using namespace std;

int main() {
    cin.sync_with_stdio(0);
    int N,I =0;
    cin >> N;
    double sum =0;
    vector<double> V(2*N);
    for(int i =0; i < 2*N; i++) {
        cin >> V[i];
        V[i] -=(int)V[i];
        if(V[i] < -soclose) V[i] +=1;
        if(abs(V[i]) < soclose) I++;
        sum +=V[i];}
    double ans =2*N;
    for(int i =0; i <= I; i++) {
        // i celych zaokruhlim nahor
        // I-i celych nadol
        if(I-i > N || i > N) continue;
        ans =min(ans,abs(N-i-sum));}
    cout << fixed << setprecision(3) << ans << "\n";
    return 0;}

// look at my code
// my code is amazing


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#define _int64 long long

int a[10000];
int d[5000][2500];

int main()
{
  int i,n,tot,best,tot1;
  double x;
  scanf("%d",&n);
  for (i=0;i<n+n;i++)
  {
    scanf("%lf",&x);
    a[i]=(x*1000+0.5);
    a[i]%=1000;
  }
  tot=0;
  tot1=0;
  for (i=0;i<n+n;i++)
  {
    tot+=a[i];
    if (a[i]!=0) tot1++;
  }
  best=2000000000;
  for (i=n-(tot-tot1);i<=tot1&&i<=n;i++)
  {
    if (i<0) i=0;
    if (abs(tot-i*1000)<best) best=abs(tot-i*1000);
  }
  printf("%.3lf\n",best/1000.0);
}


#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#define _int64 long long

int a[10000];
int d[5000][2500];

int main()
{
  int i,n,tot,best,tot1;
  double x;
  scanf("%d",&n);
  for (i=0;i<n+n;i++)
  {
    scanf("%lf",&x);
    a[i]=(x*1000+0.5);
    a[i]%=1000;
  }
  tot=0;
  tot1=0;
  for (i=0;i<n+n;i++)
  {
    tot+=a[i];
    if (a[i]!=0) tot1++;
  }
  best=2000000000;
  for (i=tot1-n;i<=tot1&&i<=n;i++)
  {
    if (i<0) i=0;
    if (abs(tot-i*1000)<best) best=abs(tot-i*1000);
  }
  printf("%.3lf\n",best/1000.0);
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

double S;
int N, Z, C;
using namespace std;
vector<double> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        double r;
        scanf("%lf", &r);
        r -= (int) r;

        if(r < 0.001)
            Z++;
        else
        {
            C++;
            S -= r;
        }
    }

    double add = 0.0;
    S += (C+1) / 2;
    V.push_back(S);

    while(Z > 1 && C > 1)
    {
        S -= 1.0;
        V.push_back(S+add);
        V.push_back(S-add);
        add += 1.0, Z -= 2, C -= 2;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    printf("%.3lf", V[0]);
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

int N, Z, C, S;
using namespace std;
vector<int> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        while(true)
        {
            char c;
            scanf("%c", &c);
            if(c == '.')
                break;
        }

        char c1, c2, c3;
        scanf("%c%c%c", &c1, &c2, &c3);
        c1 -= '0', c2 -= '0', c3 -= '0';
        int n = 100*c1 + 10*c2 + c3;

        if(n == 0)
            Z++;
        else
        {
            C++;
            S -= n;
        }
    }

    int add = 1000;
    S += 1000  * ((C+1) / 2);
    V.push_back(S);
    if(C%2)
        V.push_back(S-1000);

    while(Z > 1 && C > 1)
    {
        V.push_back(S+add);
        if(C%2)
        {
            V.push_back(S+add-1000);
            V.push_back(S-add-1000);
        }
        V.push_back(S-add);
        add += 1000, Z -= 2, C -= 2;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    int n = V[0] / 1000;
    int d = V[0] % 1000;
    printf("%d.", n);
    if(d < 100)
        printf("0");
    if(d < 10)
        printf("0");
    printf("%d",d);
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

double S;
int N, Z, C;
using namespace std;
vector<double> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        double r;
        scanf("%lf", &r);
        r -= (int) r;

        if(r < 0.001)
            Z++;
        else
        {
            C++;
            S -= r;
        }
    }

    double add = 1.000;
    S += (C+1) / 2;
    V.push_back(S);

    while(Z > 1 && C > 1)
    {
        V.push_back(S+add);
        V.push_back(S-add);
        add += 1.000, Z -= 2, C -= 2;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    printf("%.4lf", V[0]);
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

double S;
int N, Z, C;
using namespace std;
vector<double> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        double r;
        scanf("%lf", &r);
        r -= (int) r;

        if(r < 0.001)
            Z++;
        else
        {
            C++;
            S -= r;
        }
    }

    double add = 1.0;
    S += (C+1) / 2;
    V.push_back(S);

    while(Z > 1 && C > 1)
    {
        S -= 1.0;
        V.push_back(S+add);
        V.push_back(S-add);
        add += 1.0, Z -= 2, C -= 2;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    printf("%.3lf", V[0]);
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

int N, Z, C, S;
using namespace std;
vector<int> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        while(true)
        {
            char c;
            scanf("%c", &c);
            if(c == '.')
                break;
        }

        char c1, c2, c3;
        scanf("%c%c%c", &c1, &c2, &c3);
        c1 -= '0', c2 -= '0', c3 -= '0';
        int n = 100*c1 + 10*c2 + c3;

        if(n == 0)
            Z++;
        else
        {
            C++;
            S -= n;
        }
    }

    int add = 1000;
    S += 1000  * ((C+1) / 2);
    V.push_back(S);
    if(C%2)
        V.push_back(S-1000);

    while(Z > 1 && C > 1)
    {
        V.push_back(S+add);
        V.push_back(S-add);
        add += 1000, Z -= 2, C -= 2;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    int n = V[0] / 1000;
    int d = V[0] % 1000;
    printf("%d.", n);
    if(d < 100)
        printf("0");
    if(d < 10)
        printf("0");
    printf("%d",d);
}


#include <algorithm>
#include <cstdio>

#define MAX 2005

double A[MAX];
int N;
using namespace std;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        scanf("%lf", &A[i]);
        A[i] -= (int) A[i];
    }

    sort(A, A+2*N);

    double add = 0, sub = 0;
    int i = 0, j = 2*N-1;

    while(A[i] < 0.001)
        i++;

    while(i < j)
    {
        double case_a = abs(add + 1 - A[j] - (sub + A[i]));
        double case_b = abs(add + 1 - A[i] - (sub - A[j]));

        if(case_a < case_b)
            sub += A[i], add += 1 - A[j];
        else
            sub += A[j], add += 1 - A[i];

        i++, j--;
    }

    double ans = abs(add - sub);

    if(i == j)
    {
        double case_a = abs(add - sub - A[i]);
        double case_b = abs(add - sub + 1 - A[i]);

        ans = min(case_a, case_b);
    }

    printf("%.3lf\n", ans);
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

double S;
int N, Z, C;
using namespace std;
vector<double> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        double r;
        scanf("%lf", &r);
        r -= (int) r;

        if(r < 0.001)
            Z++;
        else
        {
            C++;
            S -= r;
        }
    }

    S += (C+1) / 2;
    V.push_back(S);

    while(Z > 0 && C > 0)
    {
        S += 1.0;
        V.push_back(S);
        Z--, C--;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    printf("%.3lf", V[0]);
}


#include <algorithm>
#include <cstdio>

#define MAX 2005

double A[MAX];
int N;
using namespace std;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        scanf("%lf", &A[i]);
        A[i] -= (int) A[i];
    }

    sort(A, A+N);

    double add = 0, sub = 0;
    int i = 0, j = 2*N-1;

    while(A[i] < 0.001)
        i++;

    while(i < j)
    {
        sub += A[i], add += 1 - A[j];
        i++, j--;
    }

    double ans = add - sub;

    if(i == j)
    {
        double case_a = abs(add - sub - A[i]);
        double case_b = abs(add - sub + 1 - A[i]);

        ans = min(case_a, case_b);
    }

    printf("%.3lf\n", ans);
}


#include <algorithm>
#include <cstdio>

#define MAX 2005

double A[MAX];
int N;
using namespace std;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        scanf("%lf", &A[i]);
        A[i] -= (int) A[i];
    }

    sort(A, A+2*N);

    double add = 0, sub = 0;
    int i = 0, j = 2*N-1;

    while(A[i] < 0.001)
        i++;

    while(i < j)
    {
        sub += A[i], add += 1 - A[j];
        i++, j--;
    }

    double ans = abs(add - sub);

    if(i == j)
    {
        double case_a = abs(add - sub - A[i]);
        double case_b = abs(add - sub + 1 - A[i]);

        ans = min(case_a, case_b);
    }

    printf("%.3lf\n", ans);
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

double S;
int N, Z, C;
using namespace std;
vector<double> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        double r;
        scanf("%lf", &r);
        r -= (int) r;

        if(r < 0.001)
            Z++;
        else
        {
            C++;
            S -= r;
        }
    }

    double add = 1.0;
    S += (C+1) / 2;
    V.push_back(S);

    while(Z > 1 && C > 1)
    {
        V.push_back(S+add);
        V.push_back(S-add);
        add += 1.0, Z -= 2, C -= 2;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    printf("%.3lf", V[0]);
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

int N, Z, C, S;
using namespace std;
vector<int> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        while(true)
        {
            char c;
            scanf("%c", &c);
            if(c == '.')
                break;
        }

        char c1, c2, c3;
        scanf("%c%c%c", &c1, &c2, &c3);
        c1 -= '0', c2 -= '0', c3 -= '0';
        int n = 100*c1 + 10*c2 + c3;

        if(n == 0)
            Z++;
        else
        {
            C++;
            S -= n;
        }
    }

    int add = 1000;
    S += 1000  * ((C+1) / 2);
    V.push_back(S);

    while(Z > 1 && C > 1)
    {
        V.push_back(S+add);
        V.push_back(S-add);
        add += 1000, Z -= 2, C -= 2;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    int n = V[0] / 1000;
    int d = V[0] % 1000;
    printf("%d.", n);
    if(d < 100)
        printf("0");
    if(d < 10)
        printf("0");
    printf("%d",d);
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

double S;
int N, Z, C;
using namespace std;
vector<double> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        double r;
        scanf("%lf", &r);
        r -= (int) r;

        if(r < 0.001)
            Z++;
        else
        {
            C++;
            S -= r;
        }
    }

    S += (C+1) / 2;
    V.push_back(S);

    while(Z > 0 && C > 0)
    {
        S -= 1.0;
        V.push_back(S);
        Z--, C--;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    printf("%.3lf", V[0]);
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

int N, Z, C, S;
using namespace std;
vector<int> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        while(true)
        {
            char c;
            scanf("%c", &c);
            if(c == '.')
                break;
        }

        char c1, c2, c3;
        scanf("%c%c%c", &c1, &c2, &c3);
        c1 -= '0', c2 -= '0', c3 -= '0';
        int n = 100*c1 + 10*c2 + c3;

        if(n == 0)
            Z++;
        else
        {
            C++;
            S -= n;
        }
    }

    int add = 1000;
    S += 1000  * ((C+1) / 2);
    V.push_back(S);

    while(Z > 1 && C > 1)
    {
        V.push_back(S+add);
        V.push_back(S-add);
        add += 1000, Z -= 2, C -= 2;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    int n = V[0] / 1000;
    int d = V[0] % 1000;
    printf("%d.%d", n, d);
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

double S;
int N, Z, C;
using namespace std;
vector<double> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        double r;
        scanf("%lf", &r);
        r -= (int) r;

        if(r < 0.001)
            Z++;
        else
        {
            C++;
            S -= r;
        }
    }

    double add = 1.000;
    S += (C+1) / 2;
    V.push_back(S);

    while(Z > 1 && C > 1)
    {
        V.push_back(S+add);
        V.push_back(S-add);
        add += 1.000, Z -= 2, C -= 2;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    printf("%.3lf", V[0]);
}


#include <algorithm>
#include <cstdio>

#define MAX 2005

double A[MAX];
int N;
using namespace std;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        scanf("%lf", &A[i]);
        A[i] -= (int) A[i];
    }

    sort(A, A+2*N);

    double add = 0, sub = 0;
    int i = 0, j = 2*N-1;

    while(A[i] < 0.001)
        i++;

    while(i < j)
    {
        double case_a = abs(add + 1 - A[j] - (sub + A[i]));
        double case_b = abs(add + 1 - A[i] - (sub - A[j]));

        if(case_a < case_b)
            sub += A[i], add += 1 - A[j];
        else
            sub += A[j], add += 1 - A[i];

        i++, j--;
    }

    double ans = abs(add - sub);

    if(i == j)
    {
        double case_a = abs(add - sub - A[i]);
        double case_b = abs(add - sub + 1 - A[i]);

        ans = min(case_a, case_b);
    }

    printf("%.3lf\n", min(ans, 1.0 - ans));
}


#include <algorithm>
#include <cstdio>
#include <vector>

#define MAX 2005

int N, Z, C, S;
using namespace std;
vector<int> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        while(true)
        {
            char c;
            scanf("%c", &c);
            if(c == '.')
                break;
        }

        char c1, c2, c3;
        scanf("%c%c%c", &c1, &c2, &c3);
        c1 -= '0', c2 -= '0', c3 -= '0';
        int n = 100*c1 + 10*c2 + c3;

        if(n == 0)
            Z++;
        else
        {
            C++;
            S -= n;
        }
    }

    int add = 1000;
    S += 1000  * ((C+1) / 2);
    V.push_back(S);
    if(C%2)
        V.push_back(S-1000);

    printf("%d %d %d\n", S, Z, C);

    while(Z > 1 && C > 1)
    {
        V.push_back(S+add);
        V.push_back(S-add);
        add += 1000, Z -= 2, C -= 2;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    int n = V[0] / 1000;
    int d = V[0] % 1000;
    printf("%d.", n);
    if(d < 100)
        printf("0");
    if(d < 10)
        printf("0");
    printf("%d",d);
}


#include <algorithm>
#include <cmath>
#include <cstdio>
#include <vector>

#define MAX 2005

double S;
int N, Z, C;
using namespace std;
vector<double> V;

int main()
{
    scanf("%d", &N);

    for(int i = 0; i < 2*N; i++)
    {
        double r;
        scanf("%lf", &r);
        r -= floor(r);

        if(r < 0.001)
            Z++;
        else
        {
            C++;
            S -= r;
        }
    }

    double add = 1.000;
    S += (C+1) / 2;
    V.push_back(S);

    while(Z > 1 && C > 1)
    {
        V.push_back(S+add);
        V.push_back(S-add);
        add += 1.000, Z -= 2, C -= 2;
    }

    for(int i = 0; i < V.size(); i++)
        V[i] = abs(V[i]);

    sort(V.begin(), V.end());
    printf("%.3lf", V[0]);
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <functional>
#include <queue>
using namespace std;

//{{{Commonly used macro
//-----------------------By cylixstar-----------------------//
#define REP(i, n) for (int n_##__LINE__= (n), i = 0; i < n_##__LINE__; ++i)
#define FOR(i, f, t) for (__typeof__(f) f_##__LINE__=(f), t_##__LINE__=(t), i = f_##__LINE__; i <= t_##__LINE__; ++i)
#define TR(c, it) for (__typeof__((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define ALL(c) (c).begin(), (c).end()
#define SZ(a) ((int)(a).size())
#define CLR(a, v) do { memset(a, v, sizeof(a)); } while(0)
#define DBG(a) do { std::cout << "[" << __FUNCTION__ << "]" << #a << ": " << a << endl; } while(0)

typedef long long int64;
typedef vector<int> VI;

template<typename T>
inline void checkMax(T& a, const T& b) {
  if (a < b) a = b;
}

template<typename T>
inline void checkMin(T& a, const T& b) {
  if (a > b) a = b;
}

//}}}

const int kMaxN = 2000;
int n;

int main() {
  double x;
  int tt;
  int64 s = 0;
  int num_ava = 0;
  cin >> n;
  REP (i, 2 * n) {
    cin >> x;
    tt = (int)(x * 1000.0 + 0.01);
    s += tt - (tt / 1000 * 1000);
    if (tt % 1000 != 0) {
      num_ava++;
    }
  }

  int num_not_ava = 2 * n - num_ava;
  int num_other = 0;

  while (abs(num_ava - num_other) > num_not_ava) {
    num_ava--;
    num_other++;
    s -= 1000;
  }

  int64 ans = abs(s);
  while (abs(num_ava - num_other) <= num_not_ava) {
    checkMin(ans, abs(s));
    s -= 1000;
    num_ava--;
    num_other++;
  }

  printf("0.%03d\n", (int)(ans % 1000));
  return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <functional>
#include <queue>
using namespace std;

//{{{Commonly used macro
//-----------------------By cylixstar-----------------------//
#define REP(i, n) for (int n_##__LINE__= (n), i = 0; i < n_##__LINE__; ++i)
#define FOR(i, f, t) for (__typeof__(f) f_##__LINE__=(f), t_##__LINE__=(t), i = f_##__LINE__; i <= t_##__LINE__; ++i)
#define TR(c, it) for (__typeof__((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define ALL(c) (c).begin(), (c).end()
#define SZ(a) ((int)(a).size())
#define CLR(a, v) do { memset(a, v, sizeof(a)); } while(0)
#define DBG(a) do { std::cout << "[" << __FUNCTION__ << "]" << #a << ": " << a << endl; } while(0)

typedef long long int64;
typedef vector<int> VI;

template<typename T>
inline void checkMax(T& a, const T& b) {
  if (a < b) a = b;
}

template<typename T>
inline void checkMin(T& a, const T& b) {
  if (a > b) a = b;
}

//}}}

const int kMaxN = 2000;
int n;

int main() {
  double x;
  int tt;
  int64 s = 0;
  int num_ava = 0;
  cin >> n;
  REP (i, 2 * n) {
    cin >> x;
    tt = (int)(x * 1000.0 + 0.01);
    s += tt - (tt / 1000 * 1000);
    if (tt % 1000 != 0) {
      num_ava++;
    }
  }

  int num_not_ava = 2 * n - num_ava;
  int num_other = 0;

  while (abs(num_ava - num_other) > num_not_ava) {
    num_ava--;
    num_other++;
    s -= 1000;
  }

  int64 ans = s;
  while (abs(num_ava - num_other) <= num_not_ava) {
    checkMin(ans, abs(s));
    s -= 1000;
    num_ava--;
    num_other++;
  }

  printf("0.%03d\n", (int)(ans % 1000));
  return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <functional>
#include <queue>
using namespace std;

//{{{Commonly used macro
//-----------------------By cylixstar-----------------------//
#define REP(i, n) for (int n_##__LINE__= (n), i = 0; i < n_##__LINE__; ++i)
#define FOR(i, f, t) for (__typeof__(f) f_##__LINE__=(f), t_##__LINE__=(t), i = f_##__LINE__; i <= t_##__LINE__; ++i)
#define TR(c, it) for (__typeof__((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define ALL(c) (c).begin(), (c).end()
#define SZ(a) ((int)(a).size())
#define CLR(a, v) do { memset(a, v, sizeof(a)); } while(0)
#define DBG(a) do { std::cout << "[" << __FUNCTION__ << "]" << #a << ": " << a << endl; } while(0)

typedef long long int64;
typedef vector<int> VI;

template<typename T>
inline void checkMax(T& a, const T& b) {
  if (a < b) a = b;
}

template<typename T>
inline void checkMin(T& a, const T& b) {
  if (a > b) a = b;
}

//}}}

const int kMaxN = 2000;
int n;

int main() {
  double x;
  int tt;
  int64 s = 0;
  int num_ava = 0;
  cin >> n;
  REP (i, 2 * n) {
    cin >> x;
    tt = (int)(x * 1000.0);
    s += tt - (tt / 1000 * 1000);
    if (tt % 1000 != 0) {
      num_ava++;
    }
  }

  int num_not_ava = 2 * n - num_ava;
  int num_other = 0;

  while (abs(num_ava - num_other) > num_not_ava) {
    num_ava--;
    num_other++;
    s -= 1000;
  }

  int64 ans = s;
  while (abs(num_ava - num_other) <= num_not_ava) {
    checkMin(ans, abs(s));
    s -= 1000;
    num_ava--;
    num_other++;
  }

  printf("0.%03d\n", (int)(ans % 1000));
  return 0;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <numeric>
#include <vector>
#include <map>
#include <set>
#include <utility>
#include <functional>
#include <queue>
using namespace std;

//{{{Commonly used macro
//-----------------------By cylixstar-----------------------//
#define REP(i, n) for (int n_##__LINE__= (n), i = 0; i < n_##__LINE__; ++i)
#define FOR(i, f, t) for (__typeof__(f) f_##__LINE__=(f), t_##__LINE__=(t), i = f_##__LINE__; i <= t_##__LINE__; ++i)
#define TR(c, it) for (__typeof__((c).begin()) it = (c).begin(); it != (c).end(); ++it)
#define ALL(c) (c).begin(), (c).end()
#define SZ(a) ((int)(a).size())
#define CLR(a, v) do { memset(a, v, sizeof(a)); } while(0)
#define DBG(a) do { std::cout << "[" << __FUNCTION__ << "]" << #a << ": " << a << endl; } while(0)

typedef long long int64;
typedef vector<int> VI;

template<typename T>
inline void checkMax(T& a, const T& b) {
  if (a < b) a = b;
}

template<typename T>
inline void checkMin(T& a, const T& b) {
  if (a > b) a = b;
}

//}}}

const int kMaxN = 2000;
int n;

int main() {
  double x;
  int tt;
  int64 s = 0;
  int num_ava = 0;
  cin >> n;
  REP (i, 2 * n) {
    cin >> x;
    tt = (int)(x * 1000.0 + 0.01);
    s += tt - (tt / 1000 * 1000);
    if (tt % 1000 != 0) {
      num_ava++;
    }
  }

  int num_not_ava = 2 * n - num_ava;
  int num_other = 0;

  while (abs(num_ava - num_other) > num_not_ava) {
    num_ava--;
    num_other++;
    s -= 1000;
  }

  int64 ans = abs(s);
  while (num_ava >= 0 && abs(num_ava - num_other) <= num_not_ava) {
    checkMin(ans, abs(s));
    s -= 1000;
    num_ava--;
    num_other++;
  }

  printf("%d.%03d\n", (int)(ans / 1000), (int)(ans % 1000));
  return 0;
}


#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <sstream>
using namespace std;
#pragma comment(linker, "/STACK:255000000")

typedef long long ll;

#define rep(i, a, b) for(i = (a); i < (b); ++i)
#define repb(i, a, b) for(i = (a) - 1; i >= (b); --i)
#define repd(i, a, b, d) for(i = (a); i < (b); i += (d))
#define repbd(i, a, b, d) for(i = (a) - 1; i >= (b); i -= (d))
#define reps(i, s) for(i = 0; (s)[i]; ++i)
#define repl(i, l) for(i = l.begin(); i != l.end(); ++i)

#define in(f, a) scanf("%"#f, &(a))

bool firstout = 1;

#define out(f, a) printf("%"#f, (a))
#define outf(f, a) printf((firstout) ? "%"#f : " %"#f, (a)), firstout = 0
#define nl printf("\n"), firstout = 1

#define all(x) (x).begin(),(x).end()
#define sqr(x) ((x) * (x))
#define mp make_pair

template<class T>
T &minn(T &a, T b)
{
	if(b < a) a = b;
	return a;
}

template<class T>
T &maxx(T &a, T b)
{
	if(a < b) a = b;
	return a;
}

#define inf 1012345678
#define eps 1e-9

#ifdef XDEBUG
#define mod 23
#else
#define mod 1000000007
#endif

int &madd(int &a, int b)
{
	a += b;
	if(a >= mod) a -= mod;
	return a;
}

int &msub(int &a, int b)
{
	a -= b;
	if(a < 0) a += mod;
	return a;
}

int &mmult(int &a, int b)
{
	return a = (ll)a * b % mod;
}

int mdiv(ll a, ll b, ll m)
{
	a = (a % m + m) % m;
	b = (b % m + m) % m;
	if(a % b == 0) return a / b;
	return (a + m * mdiv(-a, m, b)) / b;
}

#define N 1012
#define M 1012

int n, m, q;
int A[N];

int main()
{
#ifdef XDEBUG
	freopen("in.txt", "rt", stdin);
#else
#endif

	int i, j, k;
	char c;
	int a, d;

	int ts;
#if 0
	int tss;
	in(d, tss);
	rep(ts, 1, tss + 1)
#else
	for(ts = 1; in(d, n) > 0; ++ts)
#endif
	{
		n *= 2;
		m = 0;
		int s = 0;
		rep(i, 0, n)
		{
			scanf("%d.%d", &d, &a);
			if(a == 0) ++m;
			s += a;
		}
		int l, r;
		l = n / 2 - min(n / 2, m);
		r = min(n / 2, n - m);
		int res = inf;
		minn(res, abs(l * 1000 - s));
		minn(res, abs(r * 1000 - s));
		int t = s / 1000;
		if(l < t && t < r) minn(res, abs(t * 1000 - s));
		++t;
		if(l < t && t < r) minn(res, abs(t * 1000 - s));
		out(d, res / 1000); out(c, '.'); out(03d, res % 1000); nl;
	}

	return 0;
}


/*
 *
 * File:   p351AJeffandRounding.cpp
 * Author: Andy Y.F. Huang
 * Created on 2013-10-04, 12:26:07 PM
 */

#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <complex>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>

using namespace std;

namespace p351AJeffandRounding {
int x[8888];

void solve(int test_num) {
  int N;
  scanf("%d", &N);
  N <<= 1;
  for (int i = 0, t; i < N; i++)
    scanf("%d.%d", &t, x + i);
  sort(x, x + N);
  int res = 1 << 30;
  for (int i = 0; i < N; i++)
    x[i + N] = x[i];
  for (int st = 0; st < N; st++) {
    int diff = 0;
    for (int i = 0; i < N / 2; i++) {
      diff += x[st + i];
      if (x[st + N - i - 1] > 0)
        diff -= 1000 - x[st + N - i - 1];
    }
    res = min(res, abs(diff));
  }
  printf("%d.%03d\n", res / 1000, res % 1000);
}

void solve() {
#ifdef AZN
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  freopen("azn.txt", "w", stderr);
#endif
  solve(1);
}
}

int main() {
  p351AJeffandRounding::solve();
  return 0;
}


#include<bits/stdc++.h>
#define REP(i,m) for(int i=0;i<(m);++i)
#define REPN(i,m,in) for(int i=(in);i<(m);++i)
#define ALL(t) (t).begin(),(t).end()
#define CLR(a) memset((a),0,sizeof(a))
#define pb push_back
#define mp make_pair
#define fr first
#define sc second

using namespace std;

#ifndef ONLINE_JUDGE
#define dump(x)  cerr << #x << " = " << (x) << endl
#define prl cerr<<"called:"<< __LINE__<<endl
template<class T> void debug(T a,T b){ for(;a!=b;++a) cerr<<*a<<' ';cerr<<endl;}
#else
#define dump(x) ;
#define prl ;
template<class T> void debug(T a,T b){ ;}
#endif

template<class T> void chmin(T& a,const T& b) { if(a>b) a=b; }
template<class T> void chmax(T& a,const T& b) { if(a<b) a=b; }
typedef long long int lint;
typedef pair<int,int> pi;

namespace std{
	template<class S,class T>
	ostream &operator <<(ostream& out,const pair<S,T>& a){
		out<<'('<<a.fr<<','<<a.sc<<')';
		return out;
	}
}

lint readL(){
	lint res;
#ifdef ONLINE_JUDGE
	scanf("%I64d",&res);
#else
	scanf("%lld",&res);
#endif
	return res;
}
void printL(lint res){
#ifdef ONLINE_JUDGE
	printf("%I64d",res);
#else
	printf("%lld",res);
#endif
}

const int INF=5e8;

int n;
int ar[2005];
int main(){
	cin>>n;
	int sum=0;
	int zero=0;
	REP(i,n*2){
		double a;cin>>a;
		int A=(a*1000)+0.5;
		A%=1000;
		if(A==0) ++zero;
		sum+=A;
	}
	int add_min=max(0,n-zero),add_max=min(n,2*n-zero);

	int res=INF;
	for(int i=add_min;i<=add_max;++i){
		chmin(res,abs(i*1000-sum));
	}

	double ans=res/1000.0;
	printf("%.3f\n",ans);

	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int main() {
    int n, sum = 0, cnt = 0;
    scanf("%d", &n);
    for (int i = 0; i < n + n; ++i) {
        int a, b;
        scanf("%d.%d", &a, &b);
        sum += b;
        cnt += (0 == b);
    }
    int low = 0, high = n - max(0, cnt - n);
    int ans = 1 << 30;
    for (int k = low; k <= high; ++k)
        ans = min(ans, abs(sum - k * 1000));
    printf("%.3f\n", ans / 1000.0);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int main() {
    int n, sum = 0, cnt = 0;
    scanf("%d", &n);
    for (int i = 0; i < n + n; ++i) {
        int a, b;
        scanf("%d.%d", &a, &b);
        sum += b;
        cnt += (0 == b);
    }
    int low = max(0, n - cnt), high = n - max(0, cnt - n);
    int ans = 1 << 30;
    for (int k = low; k <= high; ++k)
        ans = min(ans, abs(sum - k * 1000));
    printf("%.3f\n", ans / 1000.0);
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int main() {
    int n, sum = 0, cnt = 0;
    scanf("%d", &n);
    for (int i = 0; i < n + n; ++i) {
        int a, b;
        scanf("%d.%d", &a, &b);
        sum += b;
        cnt += (0 == b);
    }
    int low = max(0, n - cnt), high = n - cnt / 2;
    int ans = 1 << 30;
    for (int k = low; k <= high; ++k)
        ans = min(ans, abs(sum - k * 1000));
    printf("%.3f\n", ans / 1000.0);
    return 0;
}


#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <tuple>
#include <typeinfo>
#include <unordered_set>
#include <unordered_map>
#include <vector>
using namespace std;

#define REP2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define REP(i, n) REP2(i, 0, n)
#define ALL(c) (c).begin(), (c).end()
#define PB(e) push_back(e)
#define FOREACH(i, c) for(auto i = (c).begin(); i != (c).end(); ++i)
#define MP(a, b) make_pair(a, b)
#define BIT(n, m) (((n) >> (m)) & 1)

typedef long long ll;

const ll inf = 1e15;
const ll mod = 1000 * 1000 * 1000 + 7;

int main(){
    int n;
    cin >> n;

    vector<int> D(2 * n), F(2 * n);

    int add   = 0;
    int czero = 0;

    REP(i, n * 2){
        scanf("%d.%d", &D[i], &F[i]);
        add -= F[i];
        if(F[i] == 0){
            czero++;
        }
    }

    add += max(0, 2 * n - 2 * czero) / 2;

    int amin = add;
    int amax = add + czero * 1000;
    int best = 1e8;

    for(int c = amin; c <= amax; c += 1000){
        if(abs(c) <= best){
            best = abs(c);
        }
    }

    printf("%d.%03d\n", best / 1000, best % 1000);
    return 0;
}