#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  vi s;
  int entra;
  cin >> n;
  int soma = 0;
  while (n--) {
    cin >> entra;
    if (entra % 10 != 0) s.push_back(entra);
    soma += entra;
  }
  sort((s).begin(), (s).end());
  int i = 0;
  while ((i < s.size()) && (soma % 10 == 0)) {
    soma -= s[i];
    i++;
  }
  if (i == s.size()) soma = 0;
  cout << soma << '\n';
  return 0;
}
