Hamming Distance#11432

Hamming Distance

1 second
128 megabytes
Easy

The Hamming distance between two strings and of equal length is the number of positions where the strings differ.

You are given bit strings, each of length and your task is to calculate the minimum Hamming distance between two strings.

Input

The first line has two integers n\:(2 \le n \le 2 ⋅ 10^4) and k\:(1 \le k \le 30): the number of bit strings and their length.

Then there are lines each consisting of one bit string of length .

Output

Print the minimum Hamming distance between two strings.

Examples

Example 1

Loading
Loading