#include "iostream"
#include "fstream"
#include "string"
#include "algorithm"
//#include "cmath"
using namespace std;
int ciSta(char el, char arr[]) {
int len = sizeof(arr)/sizeof(arr[0]);
for (int j=0;j<len;j++) {
if (arr[j]==el) return j;
}
return -1;
}
int main() {
ifstream in; in.open("input.txt");
ofstream out; out.open("output.txt");
int T, D, countl;
in >> T >> D;
string parole[T], parole2[T];
char lettere[T][26];
for (int j=0;j<T;j++) {
in >> parole[j];
}
for (int j=0;j<T;j++) {
parole2[j] = "";
}
for (int i=0;i<T;i++) {
countl = 0;
string str = parole[i];
for (int k;k<str.size();k++) {
if (ciSta(str[k],lettere[i])>=0) {
parole2[i] = parole2[i]+to_string(ciSta(str[k],lettere[i]));
}
else {
lettere[i][countl] = str[k]; countl++;
parole2[i] = parole2[i]+to_string(ciSta(str[k],lettere[i]));
}
}
}
int dimensioneParole = sizeof(parole2) / sizeof(parole2[0]);
int max = -1;
for (int i=0;i<T;i++) {
if (count(parole2, parole2+dimensioneParole, parole2[i])>max) {
max = count(parole2, parole2+dimensioneParole, parole2[i]);
}
}
out << max;
}
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}