let id x = x
let n = Scanf.scanf "%d\n" id
 
let array = Array.init n (fun _ -> Scanf.scanf "%d\n" id)
let () = Array.sort compare array
let l = Array.length array
  
let rec pl i =
  if i = l then 0 else
    array.(i) + pl (i+1)
     
let rec func max i =
  if i = l then 0 else
    if ((max - array.(i)) mod 10 <> 0) then max - array.(i) else
      func max (i+1)
 
let m = pl 0        
let ans = if m mod 10 <> 0 then m else func (pl 0) 0
 
let () =
  Printf.printf "%d\n" ans