#include //#include using namespace std; //using namespace atcoder; const static int NIL = -1; const long long INF = 1LL << 60; typedef long long ll; typedef unsigned long long ull; bool is_debug = false; int ini = 1000000001; ull mod = 1000000007; int main(){ int n; cin >> n; vector a(n); vector b(n); for(int i = 0; i < n; i++){ cin >> a[i]; } for(int i = 0; i < n; i++){ cin >> b[i]; } sort(a.begin(), a.end()); sort(b.begin(), b.end()); int all = 0; int win = 0; do{ do{ all++; int cnt = 0; for(int i = 0; i < n; i++){ if(a[i] > b[i])cnt++; } if(cnt * 2 > n)win++; }while(next_permutation(b.begin(), b.end())); }while(next_permutation(a.begin(), a.end())); cout << setprecision(10) << (double)win / all << endl; }