#include<bits/stdc++.h>
using namespace std;
long long splitsum(int n){
long long sum=0;
while(n>0){
sum+=n%10;
n/=10;
}
return sum;
}
int main(){
long long x,maxx=0;
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>x;
if(splitsum(x)>maxx){
maxx=splitsum(x);
}
}
cout<<maxx;
return 0;
}
求大佬帮帮出出思路吧。