#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d %d\n", &n, &m);
  int arr[105][105];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char buff;
      scanf("%c", &buff);
      arr[i][j] = buff - '0';
    }
    if (i != n - 1) scanf("\n");
  }
  set<int> best;
  for (int i = 0; i < m; i++) {
    int mx = 0;
    for (int j = 0; j < n; j++) {
      if (mx < arr[j][i]) {
        mx = arr[j][i];
      }
    }
    for (int j = 0; j < n; j++)
      if (arr[j][i] == mx) best.insert(j);
  }
  printf("%d\n", (int)best.size());
  return 0;
}
