#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	int a,b[1000],min=1000,ans=0,d=0;
	cin>>a;
	for(int i=0;i<a;i++){
		cin>>b[i];
		if(b[i]%10!=0){
			d++;
			if(min>b[i]){
				min=b[i];
			}
		}
		ans=ans+b[i];
	}
	if(d==0){
		cout<<0<<endl;
	}else if(ans%10==0){
		cout<<ans-min<<endl;
	}else{
		cout<<ans<<endl;
	}

}