Marks

题意翻译

## 题目描述 总的来说,这个小组有$N$个学生。他们获得了$M$科目的分数。每个学生从每个科目的$1$分到$9$分(包括$1$分)得了一分。 如果没有学生在这个科目上获得更高的分数,我们就可以认为这个学科这个学生是最擅长的。如果存在一个他最擅长的学科,那么这个学生就是成功的。 你的任务是找出小组中成功学生的人数。 ### 输入格式: 第一个输入行包含两个整数$N$和$M$($1\leq N,M\leq100$)— 对应学生的数量和科目的数目。接下来的$N$行每行包含$M$个字符描述的成绩单。在成绩单中每个字符是一个从$1$到$9$的数字。值得注意的是,这些数字没有被空格分开。 ### 输出格式: 输出一个数字 — 在被给的这个小组中最好的学生的数量 说明 在第一个样例中,$1$号学生是最好的科目是$1$和$3$,$2$号学生是最好的科目$1$和$2$,但$3$号学生没有任何科目最好。 在第二个样例中,每个学生至少有一个科目是最好的。 Translated by Khassar

题目描述

Vasya, or Mr. Vasily Petrov is a dean of a department in a local university. After the winter exams he got his hands on a group's gradebook. Overall the group has $ n $ students. They received marks for $ m $ subjects. Each student got a mark from $ 1 $ to $ 9 $ (inclusive) for each subject. Let's consider a student the best at some subject, if there is no student who got a higher mark for this subject. Let's consider a student successful, if there exists a subject he is the best at. Your task is to find the number of successful students in the group.

输入输出格式

输入格式


The first input line contains two integers $ n $ and $ m $ ( $ 1<=n,m<=100 $ ) — the number of students and the number of subjects, correspondingly. Next $ n $ lines each containing $ m $ characters describe the gradebook. Each character in the gradebook is a number from $ 1 $ to $ 9 $ . Note that the marks in a rows are not sepatated by spaces.

输出格式


Print the single number — the number of successful students in the given group.

输入输出样例

输入样例 #1

3 3
223
232
112

输出样例 #1

2

输入样例 #2

3 5
91728
11828
11111

输出样例 #2

3

说明

In the first sample test the student number $ 1 $ is the best at subjects $ 1 $ and $ 3 $ , student $ 2 $ is the best at subjects $ 1 $ and $ 2 $ , but student $ 3 $ isn't the best at any subject. In the second sample test each student is the best at at least one subject.