#include <bits/stdc++.h>
using namespace std;
const int MAXN = 101;
int a[MAXN][MAXN];
int maxscore[MAXN];
int main() {
  string x;
  int n, m, count = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x;
    for (int t = 0; t < m; t++) a[i][t] = x[t] - '0';
  }
  for (int i = 0; i < m; i++) {
    for (int t = 0; t < n; t++) maxscore[i] = max(maxscore[i], a[t][i]);
  }
  for (int i = 0; i < n; i++) {
    for (int t = 0; t < m; t++)
      if (a[i][t] == maxscore[t]) {
        count++;
        t = m;
      }
  }
  cout << count;
  return 0;
}
