#import <stdio.h>
#define MIN(a,b) ((a)<(b)?(a):(b))
int main(){
    int N;
    scanf("%d", &N);
    int min = 200;
    int sum = 0;
    for(int i=0;i<N;i++){
        int s;
        scanf("%d", &s);
        sum += s;
        if (s%10!=0) {
            min = MIN(min,s);
        }
    }
    if (sum%10!=0) {
        printf("%d", sum);
    } else if (min==200) {
        printf("0");
    } else {
        printf("%d", sum - min);
    }
}
