"use strict";
const Main = (input) => {
	let xs = input.trim().split('\n');
    let N = xs[0].split(" ").map(v=>parseInt(v,10));
    let S = input.split("\n").slice(1,N+1).map(v=>parseInt(v,10)); 
    const compare = (a, b) => {
    return a - b;
    }
    S.sort(compare);
    //console.log(S);
    let ans = 0;
    for(let i = 0; i<N; i++){
      ans += S[i]
    }
   // console.log(ans);
    if(ans % 10 == 0){
    for(let j = 0; j<N; j++){ 
      if(ans % 10 != 0){
       console.log(ans - S[j]);
       return;
       }
      }
     console.log(0);              
    }else{
    console.log(ans);
    }
 }
Main(require('fs').readFileSync('/dev/stdin','utf8'));