#!/usr/local/gnu/bin/bash
read n
s=(`sort -n`)
total=$((`echo ${s[@]} | tr ' ' +`))
if((total%10==0))
then
    for x in ${s[@]}
    do
        if(((total-x)%10!=0))
        then
            echo $((total-x))
            exit
        fi
    done
    echo 0
else echo $total
fi
