#include <bits/stdc++.h>
using namespace std;

int N, A[100];

int main(){
	int sum = 0;
	scanf("%d", &N);
	for(int i = 0; i < N; i++)
		scanf("%d", &A[i]), sum += A[i];
	sort(A, A + N);
	if(sum % 10 == 0){
		bool val = false;
		for(int i = 0; i < N && !val; i++)
			if(A[i] % 10 != 0)
				val = true, sum -= A[i];
		if(!val) sum = 0;
	}
	printf("%d\n", sum);
	return 0;
}
