let n = Scanf.scanf " %d" (+) 0
let ss = Array.init n @@ fun _ -> Scanf.scanf " %d" (+) 0
let sum = Array.fold_left (+) 0 ss
let _ = Printf.printf "%d\n" @@ if sum mod 10 <> 0 then sum else sum - Array.fold_left (fun m s -> if s mod 10 <> 0 then min m s else m) sum ss