#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,sum,min;
  sum=0;
  cin >> N;
  vector<int> s(110);
  for(int i=0;i<N;i++){cin >> s[i];}
  for(int i=0;i<N;i++){sum+=s[i];}
  min=sum;
  for(int i=0;i<N;i++){
    if(min>s[i] && s[i]%10!=0){min=s[i];}
  }
  if(sum%10!=0){cout << sum << endl;}
  else{cout << sum-min << endl;}
}