CF152A.Marks

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 nn students. They received marks for mm subjects. Each student got a mark from 11 to 99 (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 nn and mm ( 1<=n,m<=1001<=n,m<=100 ) — the number of students and the number of subjects, correspondingly. Next nn lines each containing mm characters describe the gradebook. Each character in the gradebook is a number from 11 to 99 . 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 11 is the best at subjects 11 and 33 , student 22 is the best at subjects 11 and 22 , but student 33 isn't the best at any subject.

In the second sample test each student is the best at at least one subject.

首页