#include <bits/stdc++.h>
using namespace std;
int a[101][101], n, m, c;
char ch;
bool h, b;
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      cin >> ch;
      int t = ch - '0';
      a[i][j] = t;
    }
  }
  for (int i = 1; i <= n; ++i) {
    h = 0;
    b = 1;
    for (int j = 1; j <= m; ++j) {
      for (int mk = 1; mk <= n; mk++) {
        if (a[i][j] < a[mk][j]) {
          b = 0;
        }
      }
      if (b) {
        c++;
        break;
      }
      b = 1;
    }
  }
  printf("%d", c);
  return 0;
}
