import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);
//aryread!string();
//auto PS = new Tuple!(long,string)[](M);
//x[]=1;でlong[]全要素1に初期化
void main()
{
    auto N = lread();
    auto S = new long[](N);
    foreach (i; 0 .. N)
    {
        auto s = lread();
        S[i] = s;
    }
    // writeln(S);
    if (func(S))
    {
        writeln(0);
        return;
    }
    long sum_S = sum(S);
    // writeln(sum_S);
    // S.sort().writeln();
    S.sort();
    if (sum_S % 10 == 0)
    {
        sum_S -= S[0];
    }
    writeln(sum_S);

}
//全部10の倍数
bool func(long[] S)
{
    foreach (i; 0 .. (S.length))
    {
        if (S[i] % 10 == 0)
        {
            continue;
        }
        else
        {
            return false;
        }
    }
    return true;
}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}

void arywrite(T)(T a)
{
    a.map!text.join(' ').writeln;
}
