#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int n, m;
char A[101][101];
int dp[101], res;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cin >> A[i][j];
      dp[j] = max(dp[j], (int)A[i][j] - 48);
    }
  for (int i = 1; i <= n; i++) {
    int sc = 0;
    for (int j = 1; j <= m; j++)
      if (((int)A[i][j] - 48) == dp[j]) sc = 1;
    res += sc;
  }
  cout << res << endl;
  return 0;
}
