You are given a set B of binary sequences of length K. Every element of B is a sequence of K values, each of them 0 or 1.
An integer sequence Zi is built by this process.
For example, Zi=(1,0,1,2,2) can be built from X=(1,0,0,1,1) and Y=(0,0,1,1,1).
You are given N integer sequences Z1,Z2,…,ZN built this way. Among all sets B that can build all N of them, find one with the fewest elements and print how many elements it has.
The first line contains K and N, separated by one space. (1≤K≤20, 1≤N≤24)
Each of the next N lines contains one sequence Zi. The j-th character of the i-th line is the value of Zi,j, and there is no separator between characters. Each value is 0, 1, or 2, and each line contains at most two 1s, so every given Zi can be built by the process above.
Print the minimum number of elements of the set B.