Problem: You play the game with your friend. The description of this game is listed below. 

Your friend creates n distinct strings of the same length m and tells you all the strings. Then he randomly chooses one of them. He chooses strings equiprobably, i.e. the probability of choosing each of the n strings equals <image>. You want to guess which string was chosen by your friend. 

In order to guess what string your friend has chosen, you are allowed to ask him questions. Each question has the following form: «What character stands on position pos in the string you have chosen?» A string is considered guessed when the answers to the given questions uniquely identify the string. After the string is guessed, you stop asking questions. 

You do not have a particular strategy, so as each question you equiprobably ask about a position that hasn't been yet mentioned. Your task is to determine the expected number of questions needed to guess the string chosen by your friend.

Input

The first line contains a single integer n (1 ≤ n ≤ 50) — the number of strings your friend came up with.

The next n lines contain the strings that your friend has created. It is guaranteed that all the strings are distinct and only consist of large and small English letters. Besides, the lengths of all strings are the same and are between 1 to 20 inclusive.

Output

Print the single number — the expected value. Your answer will be considered correct if its absolute or relative error doesn't exceed 10 - 9.

Examples

Input

2
aab
aac


Output

2.000000000000000


Input

3
aaA
aBa
Caa


Output

1.666666666666667


Input

3
aca
vac
wqq


Output

1.000000000000000

Note

In the first sample the strings only differ in the character in the third position. So only the following situations are possible: 

  * you guess the string in one question. The event's probability is <image>; 
  * you guess the string in two questions. The event's probability is <image> · <image> = <image> (as in this case the first question should ask about the position that is other than the third one); 
  * you guess the string in three questions. The event's probability is <image> · <image> · <image> = <image>; 



Thus, the expected value is equal to <image>

In the second sample we need at most two questions as any pair of questions uniquely identifies the string. So the expected number of questions is <image>.

In the third sample whatever position we ask about in the first question, we immediately identify the string.

Solution (in JAVA):

Solution:
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.PrintStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author ilyakor
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }
}

class TaskC {
    static final int[] POPCOUNT16 = new int[1 << 16];
    static {
        for (int i = 0; i < (1 << 16); ++i) {
            int x = i, cnt = 0;
            while (x > 0) {
                cnt += x % 2;
                x /= 2;
            }
            POPCOUNT16[i] = cnt;
        }
    }

    int popcount(long x) {
        int mask = (1 << 16) - 1;
        return POPCOUNT16[((int) (x & mask))] + POPCOUNT16[((int) ((x >> 16) & mask))] + POPCOUNT16[((int) ((x >> 32) & mask))] + POPCOUNT16[((int) ((x >> 48) & mask))];
    }

    long[][] A;
    long[][] curMasks;
    double[] d;
    int k, n;

    public void solve(int testNumber, InputReader in, OutputWriter out) {
        n = in.nextInt();
        String[] a = new String[n];
        for (int i = 0; i < n; ++i)
            a[i] = in.nextToken();
        k = a[0].length();
        A = new long[k][n];
        for (int i = 0; i < k; ++i)
            for (int j = 0; j < n; ++j)
                for (int t = 0; t < n; ++t)
                    if (a[j].charAt(i) == a[t].charAt(i))
                        A[i][j] |= ((long) 1L << (long) t);
        curMasks = new long[k + 1][n];
        Arrays.fill(curMasks[0], ((long) 1L << (long) n) - 1L);
        d = new double[1 << k];
        Arrays.fill(d, -1.0);
        System.err.println("Start");
        double res = calc(0, 0, ((long) 1L << (long) n) - 1L);
        res /= n;
        out.printLine(String.format("%.20f", res));
    }

    private double calc(int mask, int depth, long alive) {
        if (d[mask] > -0.5) return d[mask];
        for (int i = 0; i < n; ++i) {
            if ((alive >> i) % 2 == 0) continue;
            int val = popcount(curMasks[depth][i]);
            if (val <= 1) alive ^= (1L << (long) i);
        }
        if (alive == 0L) return 0.0;
        double weight = popcount(alive);
        double num = 0.0, den = 0.0;
        for (int i = 0; i < k; ++i) {
            if ((mask >> i) % 2 == 1) continue;
            if (d[mask ^ (1 << i)] < -0.5) {
                for (int j = 0; j < n; ++j) {
                    curMasks[depth + 1][j] = (curMasks[depth][j] & A[i][j]);
                }
            }
            den += 1.0;
            num += weight + calc(mask ^ (1 << i), depth + 1, alive);
        }
        d[mask] = num / den;
        return d[mask];
    }

}

class InputReader {
    private InputStream stream;
    private byte[] buffer = new byte[10000];
    private int cur;
    private int count;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public static boolean isSpace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public int read() {
        if (count == -1) {
            throw new InputMismatchException();
        }
        try {
            if (cur >= count) {
                cur = 0;
                count = stream.read(buffer);
                if (count <= 0)
                    return -1;
            }
        } catch (IOException e) {
            throw new InputMismatchException();
        }
        return buffer[cur++];
    }

    public int readSkipSpace() {
        int c;
        do {
            c = read();
        } while (isSpace(c));
        return c;
    }

    public String nextToken() {
        int c = readSkipSpace();
        StringBuilder sb = new StringBuilder();
        while (!isSpace(c)) {
            sb.append((char) c);
            c = read();
        }
        return sb.toString();
    }

    public int nextInt() {
        int sgn = 1;
        int c = readSkipSpace();
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res = res * 10 + c - '0';
            c = read();
        } while (!isSpace(c));
        res *= sgn;
        return res;
    }

}

class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}