'use strict'

function main(s) {

  const nums = s.split('\n').slice(1, -1).map(n => Number(n));
  let sum  = nums.reduce((a, b) => a + b);

  if (sum % 10 === 0) {
    nums.sort((a, b) => a - b);

    for (let i = 0; i < nums.length; i++) {
      if (nums[i] % 10 !== 0) {
        sum -= nums[i];
        break;
      }
    }

    if (sum % 10 === 0) {
      sum = 0;
    }
  }

  console.log(sum);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
