1 #include <stdio.h>
2 #include<stdlib.h>
3 #include<time.h>
4
5 int main()
6 {
7 int i,j,N,M;
8 int total=0;
9 int maxI,t;
10
11 //srand((unsigned int)time(0));
12 scanf("%d%d",&N,&M);
13 for(i=0;i<N;i++)
14 {
15 scanf("%d",&maxI);
16 //maxI=rand()%991+10;
17 //printf("%3d ",maxI);
18
19 for(j=1;j<M;j++)
20 {
21 scanf("%d",&t);
22 //t=rand()%991+10;
23 //printf("%3d ",t);
24
25 if(t>maxI) maxI=t;
26 }
27
28 //printf("----%d\n",maxI);
29
30 total=total+maxI;
31 }
32 printf("%d\n",total);
33 return 0;
34 }