You are given a N×M matrix of characters. In one operation you can remove a column of the matrix. You can perform as many operations as you want. Your task is to make the final matrix interesting i.e. the string formed by the characters of ith row is lexicographically smaller or equal to the string formed by the characters of the (i+1)th row. You need to use minimum number of operations possible.
An empty matrix is always a interesting matrix.
Input
The first line contains two integers Nand M.
The next N lines contain M letters each.
Output
In the output, you need to print the minimum number of operations to make the matrix interesting.
Constraints
1≤N,M≤100
There are only lowercase English alphabets as characters in the input.
Delete the first column to make the matrix interesting.