#include <bits/stdc++.h>
using namespace std;
const int INFI = 1 << 30;
const long long INFL = 1LL << 62;
const double EPS = 1e-9;
const int mod = 1000003;
int main() {
  int n, m;
  int a[101][101] = {};
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      char ch;
      cin >> ch;
      a[i][j] = ch - '0';
    }
  for (int j = 1; j <= m; j++)
    for (int i = 1; i <= n; i++)
      if (a[i][j] > a[0][j]) a[0][j] = a[i][j];
  int s = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (a[i][j] == a[0][j]) {
        s++;
        break;
      }
  cout << s;
  return 0;
}
