import sys
from collections import Counter
# 输入
n, m = map(int, sys.stdin.readline().strip().split())
matrix = []
for _ in range(n):
matrix.append(list(sys.stdin.readline().strip()))
# 矩阵转置
rol = []
for j in range(m):
string = []
for i in range(n):
string.append(matrix[i][j])
rol.append(''.join(string))
#统计相同的列数
rol_dict = Counter(rol)
print(max(rol_dict.values()))
真无语



京公网安备 11010502036488号