import std.stdio, std.string, std.conv, std.range, std.array, std.algorithm;
import std.uni, std.math, std.container, std.typecons, std.typetuple;
import core.bitop, std.datetime;

immutable int mod = 10^^9 + 7;

void main()
{
    auto N = readln.chomp.to!int;
    auto s = new int[](N);

    foreach(i ; 0 .. N) {
        readVars(s[i]);
    }

    sort(s);

    int ssum = s.sum;

    if (ssum % 10 != 0) {
        writeln(ssum);
        return;
    }

    foreach(si ; s) {
        if (si % 10 != 0) {
            writeln(ssum - si);
            return;
        }
    }

    writeln(0);
}

void readVars(T...)(auto ref T args)
{
    auto line = readln.split;
    foreach(ref arg ; args){
        arg = line.front.to!(typeof(arg));
        line.popFront;
    }
    if(!line.empty){
        writeln(line);
        throw new Exception("args num < input num");
    }
}