#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, sum = 0;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    sum += A[i];
  }
  sort(A.begin(), A.end());
  int i = 0;
  while (sum % 10 == 0) {
    sum -= A[i];
    i++;
    if (i == N) break;
  }
  cout << sum << endl;
}
