#include <iostream>
#include <string>
using namespace std;
int main(void){
    int n, s, sum = 0, min = 105;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> s;
        sum += s;
        if (s % 10 != 0) {
            if (s < min) min = s;
        }
    }
    if (min == 105) cout << 0;
    else if (sum % 10 != 0) cout << sum;
    else cout << sum - min;
    return 0;
}
