#include using namespace std; int factorial(int x) { if (x == 0) return 1; return x * factorial(x - 1); } int main() { int n; cin >> n; vector a(n), 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()); int top = 0; do { int tmp = 0; for (int i = 0; i < n; i++) tmp += (a[i] > b[i]); if (tmp > n - tmp) top++; } while (next_permutation(a.begin(), a.end())); cout << fixed << setprecision(8) << (double) top / factorial(n) << '\n'; }