N, M = list(map(int, input().split())) R = [] for i in range(N): R.append(list(map(int, input().split()))) for a in range(N): s = set() for i in range(M): r = [] for j in range(a+1): r.append(R[j][i]) m = max(r) for j in range(a+1): if r[j]==m: s.add(j) #print(m, r) print(len(s))