#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n; cin>>n;
    vector<int> s(n);
    int res=0;
    for(auto& e: s) { cin>>e; res+=e; }
    sort(begin(s), end(s));
    for(auto& e: s) {
        if (res%10==0 && e%10!=0) {
            res-=e;
            break;
        }
    }
    cout<<(res%10==0 ? 0 : res)<<endl;
}