#include <bits/stdc++.h>
using namespace std;
#define fastcin {\
    cin.tie(0);\
    ios::sync_with_stdio(false);\
}
#define rep(i, a, b) for(int i = a; i < b; i++)
#define VSORT(v) sort(v.begin(), v.end());

int main() {
    fastcin;
    int n, t, w, c = 0;
    vector<int> a, b;
    double ans = 0;
    cin >> n;
    rep(i, 0, n) {
        cin >> t;
        a.push_back(t);
    }    
    VSORT(a);
    rep(i, 0, n) {
        cin >> t;
        b.push_back(t);
    }
    do {
        w = 0;
        rep(i, 0, n) if(a[i]>b[i]) w++;
        if(w>n/2) ans++;
        c++;
    } while(next_permutation(a.begin(), a.end()));
    ans /= c;
    cout << ans << endl;
    return 0;
}