import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;
import std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	int n = read.to!int;
	
	int[] ss;
	foreach(i; 0 .. n) ss ~= read.to!int;
	
	int sum = ss.reduce!"a + b"();
	
	int ans;
	if(sum % 10 != 0) ans = sum;
	else{
		int m = sum;
		foreach(s; ss){
			if(s < m && (sum - s) % 10 != 0) m = s;
			}
		ans = sum - m;
		}
	
	ans.writeln;
	
	}