#include "bits/stdc++.h"

using namespace std;

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

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

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

	sort(a.begin(), a.end());
	int win = 0, count = 0;
	do {
		int aWin = 0, bWin = 0;
		for (int i = 0; i < n; i++) {
			if (a[i] > b[i]) {
				aWin++;
			} else {
				bWin++;
			}
		}
		
		if (aWin > bWin) {
			win++;
		}
		count++;
	} while (next_permutation(a.begin(), a.end()));
	
	double res = (double)win / count;
	printf("%.10lf\n", res);
	return 0;
}