#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int n,i,a,aa,sum,sumnr=0,nr=0,sum=0;
cin>>n;
for(i=0;i<=n;i++){
cin>>a;aa=a;
while(a!=0){
sumnr=sumnr+a%10;
a=a/10;
if(aa%sumnr==0){
sum=sum+aa;
nr=nr+1}
}
}cout<<sum/nr;
return 0 ;
}