#include <bits/stdc++.h>
using namespace std;
long long a[1000],i,n,t,nn,x;
int main()
{
freopen("lop11a.inp","r",stdin);
freopen("kq.txt","w",stdout);
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
nn=LLONG_MAX;
for (i=1;i<=n; i++)
if (100<=a[i] && a[i]<=999)
{
nn=min(nn,a[i]);
}
cout<<nn<<endl;
t=0;
while (nn>0)
{
x=nn%10;
t=t+x;
nn=nn/10;
}
cout<<t;
return 0;
}