#include <bits/stdc++.h>
int main() {
  int n, m;
  char a[101][102];
  int b[101];
  int max;
  int count;
  int i, j;
  scanf("%d %d", &n, &m);
  for (i = 0; i < n; i++) {
    b[i] = 0;
  }
  for (i = 0; i < n; i++) {
    scanf("%s", &a[i]);
  }
  for (j = 0; j < m; j++) {
    max = a[0][j] - '0';
    for (i = 0; i < n; i++) {
      if (a[i][j] - '0' > max) {
        max = a[i][j] - '0';
      }
    }
    for (i = 0; i < n; i++) {
      if (a[i][j] - '0' == max) {
        b[i] = 1;
      }
    }
  }
  count = 0;
  for (i = 0; i < n; i++) {
    if (b[i] == 1) {
      count++;
    }
  }
  printf("%d\n", count);
  return 0;
}
