#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, i, j, cnt = 0;
  char c[101][101], d[101];
  cin >> a >> b;
  for (i = 1; i <= a; i++) {
    for (j = 1; j <= b; j++) {
      cin >> c[i][j];
      if (c[i][j] > d[j]) {
        d[j] = c[i][j];
      }
    }
  }
  for (i = 1; i <= a; i++) {
    for (j = 1; j <= b; j++) {
      if (c[i][j] >= d[j]) {
        cnt++;
        break;
      }
    }
  }
  cout << cnt;
  return 0;
}
