#include <bits/stdc++.h>
char grd[101][101];
int N, M;
int ans[101];
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < N; i++) scanf("%s", grd[i]);
  for (int i = 0; i < M; ++i) {
    int max = 0;
    for (int j = 0; j < N; ++j)
      if (grd[j][i] > max) max = grd[j][i];
    for (int j = 0; j < N; ++j)
      if (grd[j][i] == max) ans[j] = 1;
  }
  int Ans = 0;
  for (int i = 0; i < N; ++i) Ans += ans[i];
  printf("%d\n", Ans);
}
