#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
 
const int maxn = 109;
int n, s, sum, best = maxn;
 
int main(){
	scanf("%d", &n);
	for (int i=1; i<=n; i++){
		scanf("%d", &s);
		sum += s;
		if (s % 10) best = min(best, s);
	}
	if (sum % 10) printf("%d\n", sum);
	else if (best != maxn) printf("%d\n", sum - best);
	else puts("0");
	return 0;
}