"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0]);
    const scores = arg.slice(1, N + 1).map(n=>parseInt(n)).sort((a,b)=>a-b);
    
    let myScore = scores.reduce((m,n)=>m+n);
    
    if(myScore % 10 === 0) {
        for(let i in scores) {
            myScore -= scores[i];
            
            if(myScore % 10 !== 0) {
                console.log(myScore);
                return;
            }
        }
    } else {
        console.log(myScore);
        return;
    }
    
    console.log(0);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));