Codeforces Round 108 (Div. 2)
A
Marks
Codeforces
900
原题
←B →
翻译中…

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.

翻译中…

Input

翻译中…

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.

翻译中…

Output

翻译中…

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

翻译中…

Note

翻译中…

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.

翻译中…

样例

Input #1
3 3
223
232
112
Output #1
2
InputCopy OutputCopy
Input #2
3 5
91728
11828
11111
Output #2
3
InputCopy OutputCopy
题目信息
题号
152A
时间限制
1 s
内存限制
256 MB
标签
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。