#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[101][101], b[101];
  int flag[100], max, i, j, n, m;
  cin >> n >> m;
  memset(a, 0, sizeof(a));
  memset(b, 0, sizeof(b));
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) cin >> a[i][j];
  int ans = 0;
  for (i = 1; i <= m; i++) {
    max = a[1][i] - '0';
    for (j = 1; j <= n; j++)
      if (a[j][i] - '0' > max) max = a[j][i] - '0';
    for (j = 1; j <= n; j++)
      if (a[j][i] - '0' == max) b[j] = 1;
  }
  for (i = 1; i <= n; i++)
    if (b[i] == 1) ans++;
  cout << ans << endl;
  return 0;
}
