#include <iostream>
using namespace std;
const int INF = 1000000000;
int n, s, sum, sma = INF;
int main(void){
    // Your code here!
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> s;
        sum += s;
        if (s % 10) sma = min(sma, s);
    }
    if (sum % 10) cout << sum << endl;
    else if (sma == INF) cout << 0 << endl;
    else cout << sum - sma << endl;
}
