n=int(input()) x=list(map(int,input().split())) sum=0 for i in range(len(x)): if(len(x)==n): x[i]=x[i]%10 sum=sum+x[i] print(sum)