#include <bits/stdc++.h>
using namespace std;
char score[110][110];
bool good[110];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> score[i][j];
    }
  }
  for (int i = 0; i < m; i++) {
    int best = -1;
    for (int j = 0; j < n; j++)
      if (score[j][i] - '0' > best) best = score[j][i] - '0';
    for (int j = 0; j < n; j++)
      if (score[j][i] - '0' == best) good[j] = true;
  }
  int cnt = 0;
  for (int i = 0; i < n; i++)
    if (good[i]) {
      cnt++;
    }
  cout << cnt;
  return 0;
}
