#include <bits/stdc++.h>
using namespace std;
int main() {
  long long r, c, cnt = 0, colmx[105];
  string sa[105];
  scanf("%lld %lld", &r, &c);
  memset(colmx, 0, sizeof colmx);
  for (int i = 0; i < r; i++) {
    cin >> sa[i];
    for (int j = 0; j < ((int)(sa[i]).size()); j++)
      colmx[j] = max(colmx[j], (long long)sa[i][j] - 48);
  }
  for (int i = 0; i < r; i++) {
    for (int j = 0; j < ((int)(sa[i]).size()); j++)
      if (sa[i][j] - 48 == colmx[j]) {
        cnt++;
        break;
      }
  }
  cout << cnt << endl;
  return 0;
}
