Kangho wants to invite N friends to a party. The friends are numbered 0 through N−1.
Each friend dislikes at most one other friend. The friend that friend i dislikes is Ai, and if Ai equals i, then friend i dislikes nobody.
Kangho invites the friends one at a time. Friend i accepts the invitation only if friend Ai has not been invited yet, or friend Ai was already invited and refused. In other words, friend i refuses exactly when friend Ai was invited earlier and accepted.
The number of friends who accept depends on the order of the invitations. Kangho therefore picks one of the N! orders uniformly at random and invites the friends in that order.
Write a program that computes the expected number of friends who accept the invitation.
Input
The first line contains the number of friends N (1≤N≤50).
The second line contains A0,A1,…,AN−1, separated by spaces (0≤Ai≤N−1).
Output
Print the expected number of friends who accept, rounded to ten digits after the decimal point, on one line. Print exactly ten digits after the point, keeping trailing zeros. No answer in the test data lies on a rounding boundary.
Note
Take N=3 with A0=0, A1=1, A2=1. Friends 0 and 1 dislike nobody, and friend 2 dislikes friend 1. There are six orders. With the order (1,0,2), friends 1 and 0 accept but friend 2 refuses. With the order (2,1,0), all three accept. Averaging over all six orders gives an expected value of 2.5.