"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);
    for(let j = 0; j<N; j++){ 
      if(ans % 10 != 0){
       break;
       }else if(ans % 10 == 0){
       ans -= S[j]
       }
      //console.log(ans);
    }   
   console.log(ans);
 }
Main(require('fs').readFileSync('/dev/stdin','utf8'));