#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main() {
	int N;
	cin >> N;
	vector<int> s(N);
	int sum = 0;
	for (int& i : s) {
		cin >> i;
		sum += i;
	}
	sort(s.begin(), s.end());
	if (sum % 10) cout << sum;
	else {
		int i;
		for (i = 0; i < N; ++i) {
			if ((sum - s[i]) % 10) break;
		}
		if (i == N) cout << 0;
		else cout << sum - s[i];
	}
}