#include #define debug(x) cerr << #x << ": " << x << '\n'; using namespace std; using ll = long long; using P = pair; const int INF = (int)1e9; int main(void){ int N; cin >> N; int a[4], b[4]; for(int i = 0; i < N; i++) cin >> a[i]; for(int i = 0; i < N; i++) cin >> b[i]; sort(a, a+N); sort(b, b+N); int win = 0, game = 0; do{ game++; int w = 0, l = 0; for(int i = 0; i < N; i++){ if(a[i] > b[i]) w++; else if(a[i] < b[i]) l++; } if(w > l) win++; }while(next_permutation(a, a+N)); printf("%lf\n", (double)win/game); return 0; }