#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<pair<double, double>> vec(n);
for (auto& [u, v] : vec) cin >> u >> v;
vector<double> ab;
for (int i = 0; i < n; i++) {
ab.push_back(vec[i].first);
ab.push_back(vec[i].second);
}
int p = 2 * n;
int ap = 1 << p;
double ans = 0;
for (int i = 0; i < ap; i++) {
double cb = 0;
double vp = 0;
double vb = 0;
for (int j = 0; j < p; j++) {
if (i & (1 << j)) {
if (j & 1) vp += ab[j];
else vb += ab[j];
cb++;
}
}
ans = max(ans, min(vp - cb, vb - cb));
}
printf("%.4lf", ans);
return 0;
}
/*
7
ABCXABC
*/