You are given an integer matrix M with N rows and L columns. Take 3N consecutive columns of M and cut them into three N×N matrices, N columns at a time from the left. Call them A, B and C in that order. If A×B=C holds, you may color that N×3N region.
If even one cell of the region you want to color is already colored, you cannot color that region. Choose the coloring order so that as many numbers as possible get colored, and find that maximum count.
Input
The first line contains two integers N and L. (1≤N≤256, 1≤N×L≤1024000)
Each of the next N lines contains one row of M. The j-th integer on the i-th of those lines is Mi,j. (0≤Mi,j≤7676767)
Output
Print the maximum number of numbers that can be colored.