open Batteries
open Printf
let () =
  let n = Scanf.scanf "%d " (fun a -> a) in
  let s_lst = Array.to_list @@ Array.init n (fun _ -> Scanf.scanf "%d " (fun a -> a)) in

  let l = List.sort compare s_lst in
  let max_ans = List.fold_left (+) 0 s_lst in
  
  let ans = 
  if max_ans mod 10 <> 0 then max_ans else
  try
  let tmp = List.find (fun x -> x mod 10 <> 0) l in
  max_ans - tmp
  with _ -> 0
  in
  Printf.printf "%d\n" ans
