#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int m, n;
  int rs = 0;
  string max;
  string score[100];
  int tmp;
  cin >> n >> m;
  for (int i = 0; i < m; i++) max += "0";
  for (int i = 0; i < n; i++) {
    cin >> score[i];
    for (int j = 0; j < m; j++)
      if (score[i][j] > max[j]) max[j] = score[i][j];
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (score[i][j] - max[j] == 0) {
        rs++;
        break;
      }
    }
  cout << rs << endl;
  return 0;
}
