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

int main() {
  int N;
  cin >> N;
  int S = 0, M = 107;
  for (int i = 0; i < N; i++) {
    int X;
    cin >> X;
    S += X;
    if (X % 10 != 0) {
      M = min(M, X);
    }
  }
  if (S % 10 != 0) cout << S << endl;
  else {
    if (M > 100) cout << 0 << endl;
    else cout << S - M << endl;
  }
}