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

int main() {
  int N;
  cin >> N;
  int ans = 0, can = 1e9;
  for (int i = 0, s; i < N && cin >> s; i++) {
    if (s % 10) can = min(can, s);
    ans += s;
  }
cout << ((ans % 10) ? ans : (can != 1e9) ? ans - can : 0) << "\n";
}