#include <bits/stdc++.h>
using namespace std;
const double PI = 3.1415926536;
const double e = 2.7182818285;
const long long MOD = 1e9 + 7;
int n, m;
string s[112];
map<int, int> mp;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  int x;
  for (int i = 0; i < m; i++) {
    x = 0;
    for (int j = 0; j < n; j++) {
      x = max(x, s[j][i] - '0');
    }
    for (int j = 0; j < n; j++) {
      if (s[j][i] - '0' == x) mp[j]++;
    }
  }
  cout << mp.size() << endl;
  return 0;
}
