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